1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 22:01:48 +01:00

Use a slightly cleaner fix

This commit is contained in:
Brown 2020-08-26 11:03:27 -04:00 committed by Daniil Gentili
parent 11ee00442d
commit 7623e31829
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

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