From 3ce782f0f109ff8e4a4685bb0e56428d3697cf71 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Dec 2022 21:14:02 +0100 Subject: [PATCH] Fixes --- .../Type/SimpleNegatedAssertionReconciler.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php index d082158de..0e88373b1 100644 --- a/src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php @@ -564,15 +564,18 @@ class SimpleNegatedAssertionReconciler extends Reconciler $properties []= $array_atomic_type->properties[$x] ?? $array_atomic_type->fallback_params[1]->setPossiblyUndefined(true); } - assert($properties !== []); $existing_var_type->removeType('array'); - $existing_var_type->addType(new TKeyedArray( - $properties, - null, - null, - true, - $array_atomic_type->from_docblock - )); + if (!$properties) { + $existing_var_type->addType(Type::getEmptyArrayAtomic()); + } else { + $existing_var_type->addType(new TKeyedArray( + $properties, + null, + null, + true, + $array_atomic_type->from_docblock + )); + } } $redundant = false; }