diff --git a/src/Psalm/Checker/TypeChecker.php b/src/Psalm/Checker/TypeChecker.php index 3990c5eab..b9e993c9f 100644 --- a/src/Psalm/Checker/TypeChecker.php +++ b/src/Psalm/Checker/TypeChecker.php @@ -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; }