mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
parent
951b943c38
commit
da170efb65
@ -3119,6 +3119,7 @@ class CallAnalyzer
|
||||
&& !($function_param->is_variadic xor $unpack)
|
||||
&& $cased_method_id !== 'echo'
|
||||
&& $cased_method_id !== 'print'
|
||||
&& $input_type->from_docblock
|
||||
&& (!$in_call_map || $context->strict_types)
|
||||
) {
|
||||
self::coerceValueAfterGatekeeperArgument(
|
||||
|
@ -100,6 +100,16 @@ class ArgTest extends TestCase
|
||||
function f(DateTime $d, int $a): void {}
|
||||
f(...$a);',
|
||||
],
|
||||
'unpackWithoutAlteringArray' => [
|
||||
'<?php
|
||||
function takeVariadicInts(int ...$inputs): void {}
|
||||
|
||||
$a = [3, 5, 7];
|
||||
takeVariadicInts(...$a);',
|
||||
[
|
||||
'$a' => 'array{0: int, 1: int, 2: int}'
|
||||
]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user