-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
inference: avoid inferring unreachable code methods #51317
Conversation
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.
LGTM. While it does introduce some complexity to our codebase, mostly due to the extra arguments in valid_as_lattice
and instanceof_tfunc
, but it's great that we now identify invalid type parameters and can fix the issue.
We also need to resolve the conflict in |
Avoids causing issues in matching_cache_argtypes/tuple_tfunc with invalid contents appearing in the Tuple parameters after intersections (such as Int, tuple of Symbol, etc). Also sharpen valid_as_lattice / instanceof_tfunc to be able to filter out and reject types that cannot appear as tags at runtime, except where they are used for non-tag queries (like fieldtype_tfunc and subtype_tfunc). Fixes #51228 (part 2)
Ah oops, it became conflicted again between the time I rebased and pushed |
Avoids causing issues in matching_cache_argtypes/tuple_tfunc with invalid contents appearing in the Tuple parameters after intersections (such as Int, tuple of Symbol, etc).
Also sharpen valid_as_lattice / instanceof_tfunc to be able to filter out and reject types that cannot appear as tags at runtime, except where they are used for non-tag queries (like fieldtype_tfunc and subtype_tfunc).
Fixes #51311
Fixes #51228 (part 2)