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,17 +344,15 @@ class TypeChecker
// fall through
}
}
if ($existing_var_type->types) {
return $existing_var_type;
}
$failed_reconciliation = true;
return Type::getMixed();
}
return $existing_var_type;
if ($existing_var_type->types) {
return $existing_var_type;
}
$failed_reconciliation = true;
return Type::getMixed();
}
if ($new_var_type === '!null' && !$existing_var_type->isMixed()) {