1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Generic key type cannot be undefined

Fixes #3905
This commit is contained in:
Brown 2020-07-29 18:46:21 -04:00
parent 7367e8e6c2
commit 96ce488241

View File

@ -220,6 +220,8 @@ class ObjectLike extends \Psalm\Type\Atomic
$key_type = TypeCombination::combineTypes($key_types);
$key_type->possibly_undefined = false;
if ($this->previous_key_type) {
$key_type = Type::combineUnionTypes($this->previous_key_type, $key_type);
}