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:
parent
1a3129b0e0
commit
202fb7026a
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user