1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 00:39:38 +01:00
This commit is contained in:
Daniil Gentili 2022-11-26 19:47:10 +01:00
parent e7f2fddf34
commit e89609bbab
2 changed files with 9 additions and 15 deletions

View File

@ -50,7 +50,7 @@ class KeyedArrayComparator
$input_properties = $input_type_part->properties;
foreach ($container_type_part->properties as $key => $container_property_type) {
if (!isset($input_properties[$key]) || $input_properties[$key]->possibly_undefined) {
if (!isset($input_properties[$key])) {
if (!$container_property_type->possibly_undefined) {
$all_types_contain = false;
}
@ -58,6 +58,14 @@ class KeyedArrayComparator
continue;
}
if ($input_properties[$key]->possibly_undefined
&& !$container_property_type->possibly_undefined
) {
$all_types_contain = false;
continue;
}
$input_property_type = $input_properties[$key];
unset($input_properties[$key]);

View File

@ -279,13 +279,6 @@ class ScalarTypeComparator
return true;
}
if ($container_type_part instanceof TIntRange
&& $container_type_part->dependent_list_key
&& $input_type_part instanceof TLiteralInt
) {
return true;
}
if (get_class($container_type_part) === TFloat::class && $input_type_part instanceof TLiteralFloat) {
return true;
}
@ -336,13 +329,6 @@ class ScalarTypeComparator
return true;
}
if ($container_type_part instanceof TIntRange
&& $container_type_part->dependent_list_key
&& $input_type_part instanceof TInt
) {
return true;
}
if (get_class($input_type_part) === TInt::class && $container_type_part instanceof TLiteralInt) {
if ($atomic_comparison_result) {
$atomic_comparison_result->type_coerced = true;