mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix #2221 - variadic args are lists
This commit is contained in:
parent
67b32f463e
commit
3658771bff
@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1236,6 +1236,20 @@ class ArrayAssignmentTest extends TestCase
|
||||
return $arr;
|
||||
}',
|
||||
],
|
||||
'unpackedArgIsList' => [
|
||||
'<?php
|
||||
final class Values
|
||||
{
|
||||
/**
|
||||
* @psalm-var list<int>
|
||||
*/
|
||||
private $ints = [];
|
||||
|
||||
public function set(int ...$ints): void {
|
||||
$this->ints = $ints;
|
||||
}
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user