mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fix #58 - treat callmap args correctly when evaluating variadic
This commit is contained in:
parent
2e4996e562
commit
1bf2139149
@ -1305,10 +1305,11 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
|
||||
}
|
||||
|
||||
foreach ($args as $argument_offset => $arg) {
|
||||
if (count($possible_function_params) <= $argument_offset &&
|
||||
(!$last_param || substr($last_param->name, 0, 3) !== '...')
|
||||
) {
|
||||
if ($argument_offset >= count($possible_function_params)) {
|
||||
if (!$last_param || !$last_param->is_variadic) {
|
||||
$all_args_match = false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -484,6 +484,8 @@ class TypeReconciliationTest extends PHPUnit_Framework_TestCase
|
||||
$a = min(0, 1);
|
||||
$b = min([0, 1]);
|
||||
$c = min("a", "b");
|
||||
$d = min(1, 2, 3, 4);
|
||||
$e = min(1, 2, 3, 4, 5);
|
||||
');
|
||||
|
||||
$file_checker = new FileChecker('somefile.php', $this->project_checker, $stmts);
|
||||
|
Loading…
Reference in New Issue
Block a user