1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Use a slightly cleaner fix

This commit is contained in:
Brown 2020-08-26 11:03:27 -04:00
parent 9878613594
commit f33d626052

View File

@ -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());
}
}
/**