From 4ea5329087cba81a8964f0b15cfcb2fbc4d80d18 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 19 Dec 2022 17:49:09 +0100 Subject: [PATCH] Never assign never to an array --- src/Psalm/Type/Reconciler.php | 4 ++++ 1 file changed, 4 insertions(+) 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);