1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Add protections

This commit is contained in:
Matthew Brown 2016-09-09 18:54:24 -04:00
parent f455851f89
commit 288ac91c4a

View File

@ -942,6 +942,10 @@ class TypeChecker
public static function hasIdenticalTypes(Type\Union $declared_type, Type\Union $inferred_type, $absolute_class)
{
if ($declared_type->isMixed() || $inferred_type->isEmpty()) {
return true;
}
if ($declared_type->isNullable() !== $inferred_type->isNullable()) {
return false;
}