-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[red-knot] Remove Type::Unbound
#13980
base: main
Are you sure you want to change the base?
Conversation
9d7b8dd
to
8e97da6
Compare
@@ -120,7 +120,7 @@ if returns_bool(): | |||
__name__ = 1 | |||
|
|||
reveal_type(__file__) # revealed: Literal[42] | |||
reveal_type(__name__) # revealed: str | Literal[1] | |||
reveal_type(__name__) # revealed: Literal[1] | str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do: restore original order?
# error: [non-subscriptable] "Cannot subscript object of type `Literal[Spam, Spam]` with no `__class_getitem__` method" | ||
# revealed: Unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do
let any_unbound = union | ||
.elements(db) | ||
.iter() | ||
.any(|ty| ty.member(db, name).is_unbound()); | ||
if any_unbound { | ||
SymbolLookupResult::Unbound // TODO | ||
} else { | ||
SymbolLookupResult::Bound( | ||
union.map(db, |ty| ty.member(db, name).expect_bound()), | ||
Boundedness::DefinitelyBound, | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do
edb4d6e
to
0175a1b
Compare
|
Early draft, no need to review
Summary
Remove
Type::Unbound
.closes #13671
TODO
todo_unwrap_type()
Do we need the concept of declaredness in addition to boundness?not necessarily for the first version of thisSymbolLookupResult
(see ideas in ticket)CallOutcome
to handle unboundness, such that we can usety.class_member(…).call(…)
, with a newSymbolLookupResult::call
method? Or maybety.class_member(…).call_result_ty(…)
?Unbound
Test Plan
TODO