From 7623e3182919c38fca0e9ff403bcbf6061525796 Mon Sep 17 00:00:00 2001 From: Brown Date: Wed, 26 Aug 2020 11:03:27 -0400 Subject: [PATCH] Use a slightly cleaner fix --- src/Psalm/Internal/Type/SimpleAssertionReconciler.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php index d7771ff37..10d6b731e 100644 --- a/src/Psalm/Internal/Type/SimpleAssertionReconciler.php +++ b/src/Psalm/Internal/Type/SimpleAssertionReconciler.php @@ -1549,11 +1549,15 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler $key_type->removeType($key); $key_type->addType(new Type\Atomic\TArrayKey()); } elseif (!$cat instanceof TString && !$cat instanceof TInt) { - // this should ideally prompt some sort of error $key_type->removeType($key); $key_type->addType(new Type\Atomic\TArrayKey()); } } + + if (!$key_type->getAtomicTypes()) { + // this should ideally prompt some sort of error + $key_type->addType(new Type\Atomic\TArrayKey()); + } } /**