1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Convert explicit array<mixed, ...> to array<array-key, ...>

This commit is contained in:
Matthew Brown 2020-02-22 11:04:58 -05:00
parent 1a3129b0e0
commit 202fb7026a

View File

@ -289,10 +289,18 @@ abstract class Type
}
if ($generic_type_value === 'array' || $generic_type_value === 'associative-array') {
if ($generic_params[0]->isMixed()) {
$generic_params[0] = Type::getArrayKey();
}
return new TArray($generic_params);
}
if ($generic_type_value === 'non-empty-array') {
if ($generic_params[0]->isMixed()) {
$generic_params[0] = Type::getArrayKey();
}
return new Type\Atomic\TNonEmptyArray($generic_params);
}