1
0
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:
Matthew Brown 2017-11-28 01:59:18 -05:00
parent e0cea0017c
commit 018843fe65

View File

@ -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;