mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Add protections
This commit is contained in:
parent
f455851f89
commit
288ac91c4a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user