From 96ce488241a99439144f3e449909605be516e0fa Mon Sep 17 00:00:00 2001 From: Brown Date: Wed, 29 Jul 2020 18:46:21 -0400 Subject: [PATCH] Generic key type cannot be undefined Fixes #3905 --- src/Psalm/Type/Atomic/ObjectLike.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Psalm/Type/Atomic/ObjectLike.php b/src/Psalm/Type/Atomic/ObjectLike.php index 8c2216317..bd6393b50 100644 --- a/src/Psalm/Type/Atomic/ObjectLike.php +++ b/src/Psalm/Type/Atomic/ObjectLike.php @@ -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); }