[red-knot] Use Unknown | T_inferred for undeclared public symbols (#15674)
## Summary Use `Unknown | T_inferred` as the type for *undeclared* public symbols. ## Test Plan - Updated existing tests - New test for external `__slots__` modifications. - New tests for external modifications of public symbols.
This commit is contained in:
@@ -262,7 +262,8 @@ class A:
|
||||
class B:
|
||||
__add__ = A()
|
||||
|
||||
reveal_type(B() + B()) # revealed: int
|
||||
# TODO: this could be `int` if we declare `B.__add__` using a `Callable` type
|
||||
reveal_type(B() + B()) # revealed: Unknown | int
|
||||
```
|
||||
|
||||
## Integration test: numbers from typeshed
|
||||
|
||||
Reference in New Issue
Block a user