-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Fix panic when trying to pull types for subscript expressions inside Callable type expressions
#18534
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
Conversation
|
|
The new primer hits are because for this snippet: from basedtyping import P
reveal_type(P)We infer the type of |
6f76d88 to
7f6f3e2
Compare
|
With this PR, we also succeed in pulling types for the entirety of typeshed's |
ecf92a6 to
8e30df3
Compare
dhruvmanila
left a comment
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.
Looks good, thanks!
| if arguments_slice.is_tuple_expr() { | ||
| self.store_expression_type(arguments_slice, ty); | ||
| } |
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.
This is only being done for tuple expressions because otherwise it would already be present via the self.infer_type_expression(argument) call?
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.
Yup, exactly!
8e30df3 to
bd4a0f2
Compare
bd4a0f2 to
021b2db
Compare
…side `Callable` type expressions (astral-sh#18534)
Summary
We weren't storing types for subscript expressions inside the parameter list of
Callabletype expressions; this was the cause of the corpus test failures for two files in our vendored copy of typeshed.Test Plan
KNOWN_FAILUREScorpus list