Skip to content

Commit fb564eb

Browse files
committed
clarify we don't narrow the left operand
1 parent 620da98 commit fb564eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-data/unit/check-typeddict.test

+4
Original file line numberDiff line numberDiff line change
@@ -2078,8 +2078,12 @@ else:
20782078
foo_or_invalid: Literal['foo', 'invalid']
20792079
if foo_or_invalid in d:
20802080
assert_type(d, D1)
2081+
# won't narrow 'foo_or_invalid'
2082+
assert_type(foo_or_invalid, Literal['foo', 'invalid'])
20812083
else:
20822084
assert_type(d, Union[D1, D2])
2085+
# won't narrow 'foo_or_invalid'
2086+
assert_type(foo_or_invalid, Literal['foo', 'invalid'])
20832087

20842088
TD = TypeVar('TD', D1, D2)
20852089

0 commit comments

Comments
 (0)