Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Dec 19, 2023
1 parent 456a5cd commit 2fa024e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
) {
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic/TKeyedArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 2fa024e

Please sign in to comment.