diff --git a/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php b/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php index c9ac356eb68..8a39b72c976 100644 --- a/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php +++ b/src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php @@ -51,19 +51,6 @@ public static function isContainedBy( return true; } - if ($container_type_part instanceof TKeyedArray - && $input_type_part instanceof TArray - && !$container_type_part->is_list - && !$container_type_part->isNonEmpty() - && !$container_type_part->isSealed() - && $input_type_part->equals( - $container_type_part->getGenericArrayType(), - false, - ) - ) { - return true; - } - if ($container_type_part instanceof TKeyedArray && $input_type_part instanceof TArray ) { diff --git a/src/Psalm/Type/Atomic/TKeyedArray.php b/src/Psalm/Type/Atomic/TKeyedArray.php index ed6a9c6cfb5..f3c10394ad7 100644 --- a/src/Psalm/Type/Atomic/TKeyedArray.php +++ b/src/Psalm/Type/Atomic/TKeyedArray.php @@ -416,7 +416,7 @@ public function getGenericArrayType(?string $list_var_id = null): TArray $value_type = $value_type->setPossiblyUndefined(false); - if ($has_defined_keys || $this->fallback_params !== null) { + if ($has_defined_keys) { return new TNonEmptyArray([$key_type, $value_type]); } return new TArray([$key_type, $value_type]);