diff --git a/src/Psalm/Type/Union.php b/src/Psalm/Type/Union.php index c3283b8a393..63dcce98c30 100644 --- a/src/Psalm/Type/Union.php +++ b/src/Psalm/Type/Union.php @@ -625,7 +625,7 @@ public function hasType($type_string) */ public function hasArray() { - return isset($this->types['array']); + return isset($this->types['array']) || isset($this->types['callable-array']); } /** diff --git a/tests/CallableTest.php b/tests/CallableTest.php index 55f4d0243ce..08f60f9daea 100644 --- a/tests/CallableTest.php +++ b/tests/CallableTest.php @@ -713,6 +713,24 @@ function c(callable $c) : void { } }' ], + 'destructureCallableArray' => [ + ' 'class-string|object', + '$method' => 'string' + ] + ], ]; }