mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Don’t coerce false to null when coming from ignore-false type
This commit is contained in:
parent
be4894c8e0
commit
c68dcf2f74
@ -1132,8 +1132,10 @@ class ArrayFetchAnalyzer
|
||||
}
|
||||
|
||||
if ($offset_type_part instanceof Type\Atomic\TFalse) {
|
||||
$offset_type->addType(new Type\Atomic\TLiteralInt(0));
|
||||
$offset_type->removeType($key);
|
||||
if (!$offset_type->ignore_falsable_issues) {
|
||||
$offset_type->addType(new Type\Atomic\TLiteralInt(0));
|
||||
$offset_type->removeType($key);
|
||||
}
|
||||
} elseif ($offset_type_part instanceof Type\Atomic\TTrue) {
|
||||
$offset_type->addType(new Type\Atomic\TLiteralInt(1));
|
||||
$offset_type->removeType($key);
|
||||
|
Loading…
Reference in New Issue
Block a user