[red-knot] Type narrow in else clause (#13918)
## Summary Add support for type narrowing in elif and else scopes as part of #13694. ## Test Plan - mdtest - builder unit test for union negation. --------- Co-authored-by: Carl Meyer <carl@astral.sh>
This commit is contained in:
@@ -23,7 +23,8 @@ reveal_type(b) # revealed: Unknown
|
||||
## Function return
|
||||
|
||||
```py
|
||||
def int_instance() -> int: ...
|
||||
def int_instance() -> int:
|
||||
return 42
|
||||
|
||||
a = "abcde"[int_instance()]
|
||||
# TODO: Support overloads... Should be `str`
|
||||
|
||||
Reference in New Issue
Block a user