diff --git a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php index 77817207a..ba5886652 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php @@ -894,10 +894,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements if ($function_param->is_variadic) { $var_type = new Type\Union([ - new Type\Atomic\TArray([ - Type::getInt(), - $param_type, - ]), + new Type\Atomic\TList($param_type), ]); } diff --git a/tests/ArrayAssignmentTest.php b/tests/ArrayAssignmentTest.php index a997d401d..9dfa0c1ca 100644 --- a/tests/ArrayAssignmentTest.php +++ b/tests/ArrayAssignmentTest.php @@ -1236,6 +1236,20 @@ class ArrayAssignmentTest extends TestCase return $arr; }', ], + 'unpackedArgIsList' => [ + ' + */ + private $ints = []; + + public function set(int ...$ints): void { + $this->ints = $ints; + } + }' + ], ]; }