mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix combination of non-falsy-string and falsy literal
This commit is contained in:
parent
9c814c8a69
commit
dfbc9dd177
@ -1038,11 +1038,6 @@ class TypeCombiner
|
||||
&& $type->value
|
||||
) {
|
||||
// do nothing
|
||||
} elseif (isset($combination->value_types['string'])
|
||||
&& $combination->value_types['string'] instanceof TNonEmptyString
|
||||
&& $type->value !== ''
|
||||
) {
|
||||
// do nothing
|
||||
} else {
|
||||
$combination->value_types['string'] = new TString();
|
||||
}
|
||||
|
@ -860,6 +860,13 @@ class TypeCombinationTest extends TestCase
|
||||
'non-empty-literal-string',
|
||||
],
|
||||
],
|
||||
'nonFalsyStringAndFalsyLiteral' => [
|
||||
'string',
|
||||
[
|
||||
'non-falsy-string',
|
||||
'"0"',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user