diff --git a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php index eb45e931a..d92097202 100644 --- a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php @@ -2650,6 +2650,10 @@ class SimpleAssertionReconciler extends Reconciler ) { $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; diff --git a/src/Psalm/Internal/Type/TypeParser.php b/src/Psalm/Internal/Type/TypeParser.php index e4fae85ef..99cf82a4d 100644 --- a/src/Psalm/Internal/Type/TypeParser.php +++ b/src/Psalm/Internal/Type/TypeParser.php @@ -1411,6 +1411,7 @@ class TypeParser !is_numeric($property_key) || ($had_optional && !$property_maybe_undefined) || $type === 'array' + || $type === 'callable-array' || $previous_property_key != ($property_key - 1) ) ) {