Skip to content
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

Merged
merged 2 commits into from
Sep 27, 2023
Merged

Conversation

vtjnash
Copy link
Sponsor Member

@vtjnash vtjnash commented Sep 14, 2023

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)

Copy link
Sponsor Member

@aviatesk aviatesk left a 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.

base/compiler/abstractinterpretation.jl Outdated Show resolved Hide resolved
base/compiler/tfuncs.jl Show resolved Hide resolved
@aviatesk
Copy link
Sponsor Member

We also need to resolve the conflict in test/compiler/inference.jl.

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)
@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Sep 26, 2023

Ah oops, it became conflicted again between the time I rebased and pushed

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Sep 26, 2023
@aviatesk aviatesk merged commit 0a82b71 into master Sep 27, 2023
7 checks passed
@aviatesk aviatesk deleted the jn/51228TT branch September 27, 2023 09:31
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assertion error during type size limiting Internal errors caused by broken Varargs
3 participants