Handle maybe-unbound __iadd__-like operators in augmented assignments (#14044)
## Summary One of the follow-ups from augmented assignment inference, now that `Type::Unbound` has been removed. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -85,7 +85,7 @@ f = Foo()
|
||||
# that `Foo.__iadd__` may be unbound as additional context.
|
||||
f += "Hello, world!"
|
||||
|
||||
reveal_type(f) # revealed: int
|
||||
reveal_type(f) # revealed: int | @Todo
|
||||
```
|
||||
|
||||
## Partially bound with `__add__`
|
||||
@@ -104,8 +104,7 @@ class Foo:
|
||||
f = Foo()
|
||||
f += "Hello, world!"
|
||||
|
||||
# TODO(charlie): This should be `int | str`, since `__iadd__` may be unbound.
|
||||
reveal_type(f) # revealed: int
|
||||
reveal_type(f) # revealed: int | str
|
||||
```
|
||||
|
||||
## Partially bound target union
|
||||
|
||||
Reference in New Issue
Block a user