Skip to content

Commit

Permalink
Rollback some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
robchett committed Oct 17, 2023
1 parent 889bdca commit 0f8a320
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Psalm/Internal/Type/SimpleAssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,10 @@ private static function reconcileCallable(
) {
$callable_types[] = $type;
$redundant = false;
} elseif ($type instanceof TArray) {
$type = new TCallableKeyedArray($type->type_params);
$callable_types[] = $type;
$redundant = false;
} elseif ($type instanceof TKeyedArray && count($type->properties) === 2) {
$type = new TCallableKeyedArray($type->properties);
$callable_types[] = $type;
Expand Down
1 change: 1 addition & 0 deletions src/Psalm/Internal/Type/TypeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ private static function getTypeFromKeyedArrayTree(
!is_numeric($property_key)
|| ($had_optional && !$property_maybe_undefined)
|| $type === 'array'
|| $type === 'callable-array'
|| $previous_property_key != ($property_key - 1)
)
) {
Expand Down

0 comments on commit 0f8a320

Please sign in to comment.