mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +01:00
Make sure to set object-like property type if available
This commit is contained in:
parent
e04441b8ac
commit
89bc501e17
@ -3945,6 +3945,9 @@ class StatementsChecker
|
|||||||
elseif ($type instanceof Type\Generic) {
|
elseif ($type instanceof Type\Generic) {
|
||||||
$stmt->inferredType = $type->type_params[$value_index];
|
$stmt->inferredType = $type->type_params[$value_index];
|
||||||
}
|
}
|
||||||
|
elseif ($key_value && isset($type->properties[$key_value])) {
|
||||||
|
$stmt->inferredType = clone $type->properties[$key_value];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($type->isString()) {
|
elseif ($type->isString()) {
|
||||||
if ($key_type) {
|
if ($key_type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user