mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Prevent empty type array when evaluating !falsy
This commit is contained in:
parent
e0cea0017c
commit
018843fe65
@ -344,6 +344,7 @@ class TypeChecker
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($existing_var_type->types) {
|
||||
return $existing_var_type;
|
||||
@ -354,9 +355,6 @@ class TypeChecker
|
||||
return Type::getMixed();
|
||||
}
|
||||
|
||||
return $existing_var_type;
|
||||
}
|
||||
|
||||
if ($new_var_type === '!null' && !$existing_var_type->isMixed()) {
|
||||
$did_remove_type = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user