From 3437d762af31ec579193fc552de2309177c6478a Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 3 Dec 2022 18:21:11 +0100 Subject: [PATCH] Fix --- src/Psalm/Type/Atomic/TKeyedArray.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Type/Atomic/TKeyedArray.php b/src/Psalm/Type/Atomic/TKeyedArray.php index b1e951edb..f7bca048b 100644 --- a/src/Psalm/Type/Atomic/TKeyedArray.php +++ b/src/Psalm/Type/Atomic/TKeyedArray.php @@ -398,7 +398,7 @@ class TKeyedArray extends Atomic { if ($this->is_list) { foreach ($this->properties as $k => $property) { - if ($property->possibly_undefined) { + if ($property->possibly_undefined || $property->isNever()) { /** @var int<0, max> */ return $k; } @@ -407,7 +407,7 @@ class TKeyedArray extends Atomic } $prop_min_count = 0; foreach ($this->properties as $property) { - if (!$property->possibly_undefined) { + if (!($property->possibly_undefined || $property->isNever())) { $prop_min_count++; } }