From a1df08f718aaa5aa8dcedf036d03089c12aa72b5 Mon Sep 17 00:00:00 2001 From: orklah Date: Sat, 9 Oct 2021 18:18:15 +0200 Subject: [PATCH] fix an old test --- .../Expression/Call/FunctionCallReturnTypeFetcher.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php index 80ff7d3a438..e5ea1e813f5 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php @@ -348,6 +348,13 @@ private static function getReturnTypeFromCallMapWithArgs( return new Type\Union([new Type\Atomic\TIntRange($min, null)]); } + if ($atomic_types['array'] instanceof Type\Atomic\TArray + && $atomic_types['array']->type_params[0]->isEmpty() + && $atomic_types['array']->type_params[1]->isEmpty() + ) { + return Type::getInt(false, 0); + } + return new Type\Union([ new Type\Atomic\TLiteralInt(0), new Type\Atomic\TPositiveInt