Skip to content

Commit 2182e5d

Browse files
committed
add testAvoidFalseNonOverlappingEqualityCheckInLoop3
1 parent 016eda6 commit 2182e5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test-data/unit/check-narrowing.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,15 @@ while True:
24722472
x = B()
24732473
[builtins fixtures/primitives.pyi]
24742474

2475+
[case testAvoidFalseNonOverlappingEqualityCheckInLoop3]
2476+
# flags: --strict-equality
2477+
2478+
for y in [1.0]:
2479+
if y is not None or y != "None": # E: Non-overlapping equality check (left operand type: "float", right operand type: "Literal['None']")
2480+
...
2481+
2482+
[builtins fixtures/primitives.pyi]
2483+
24752484
[case testNarrowPromotionsInsideUnions1]
24762485

24772486
from typing import Union

0 commit comments

Comments
 (0)