1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Don’t complain about mixed after unpacking arg

This commit is contained in:
Matthew Brown 2019-01-21 17:42:25 -05:00
parent e0067e53c5
commit ea137fc20c
2 changed files with 12 additions and 8 deletions

View File

@ -1151,15 +1151,19 @@ class CallAnalyzer
} elseif ($function_param) {
$codebase->analyzer->incrementMixedCount($statements_analyzer->getFilePath());
if ($function_param->type && !$function_param->type->hasMixed()) {
$param_type = $function_param->type;
if ($function_param->is_variadic && $function_param->type->hasArray()) {
/** @var TArray */
$array_type = $function_param->type->getTypes()['array'];
$param_type = $function_param->type;
$param_type = $array_type->type_params[1];
}
if ($function_param->is_variadic
&& $param_type
&& $param_type->hasArray()
) {
/** @var TArray */
$array_type = $param_type->getTypes()['array'];
$param_type = $array_type->type_params[1];
}
if ($param_type && !$param_type->hasMixed()) {
if (IssueBuffer::accepts(
new MixedArgument(
'Argument ' . ($argument_offset + 1) . ' of ' . $cased_method_id

View File

@ -1083,7 +1083,7 @@ class TemporaryUpdateTest extends \Psalm\Tests\TestCase
}',
],
],
'error_positions' => [[238, 238, 280], []],
'error_positions' => [[238, 238], []],
],
];
}