diff --git a/src/Psalm/Type/Reconciler.php b/src/Psalm/Type/Reconciler.php index 9bf4d261d63..006850317e5 100644 --- a/src/Psalm/Type/Reconciler.php +++ b/src/Psalm/Type/Reconciler.php @@ -1093,6 +1093,10 @@ private static function adjustTKeyedArrayType( array &$changed_var_ids, Union $result_type ): void { + if ($result_type->isNever()) { + return; + } + array_pop($key_parts); $array_key = array_pop($key_parts); array_pop($key_parts);