From 0f8a3204f37c2290f96979bec099315037e5b176 Mon Sep 17 00:00:00 2001 From: robchett Date: Tue, 17 Oct 2023 21:47:12 +0100 Subject: [PATCH] Rollback some changes --- src/Psalm/Internal/Type/SimpleAssertionReconciler.php | 4 ++++ src/Psalm/Internal/Type/TypeParser.php | 1 + 2 files changed, 5 insertions(+) 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) ) ) {