Properly restore constraints

This commit is contained in:
David Peter
2024-11-28 22:38:08 +01:00
parent 41d19c3c29
commit dc55b4c8a2
7 changed files with 105 additions and 64 deletions

View File

@@ -38,7 +38,7 @@ if (x := 1) and bool_instance():
if True or (x := 1):
# TODO: infer that the second arm is never executed, and raise `unresolved-reference`.
# error: [possibly-unresolved-reference]
reveal_type(x) # revealed: Literal[1]
reveal_type(x) # revealed: Never
if True and (x := 1):
# TODO: infer that the second arm is always executed, do not raise a diagnostic