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

Fix apply_type_tfunc for Union{T::TypeVar} #48384

Merged
merged 1 commit into from
Jan 24, 2023
Merged

Fix apply_type_tfunc for Union{T::TypeVar} #48384

merged 1 commit into from
Jan 24, 2023

Conversation

martinholters
Copy link
Member

The type parameters to Union may be Types or TypeVars, but apply_type_tfunc failed to recognize the latter as valid in the single-argument case.

Fixes #48374.

The type parameters to `Union` may be `Type`s or `TypeVar`s, but
`apply_type_tfunc` failed to recognize the latter as valid in the
single-argument case.
@martinholters martinholters added bugfix This change fixes an existing bug compiler:inference Type inference backport 1.9 Change should be backported to release-1.9 labels Jan 23, 2023
@martinholters
Copy link
Member Author

CI failure is due to 2 errors in threads test on x86_64-apple-darwin only, likely unrelated.

@martinholters martinholters requested a review from vtjnash January 24, 2023 08:28
@@ -1713,7 +1713,7 @@ const _tvarnames = Symbol[:_A, :_B, :_C, :_D, :_E, :_F, :_G, :_H, :_I, :_J, :_K,
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if branch has a weird isa(ai, Type) instead of ai = widenconst(ai) call

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A brief look at the history reveals that it was added by some @martinholters in #27150 who apparently had no clue what he was doing, but merged it after @vtjnash had given his approval. 😄

@vtjnash vtjnash merged commit 30d11a3 into master Jan 24, 2023
@vtjnash vtjnash deleted the mh/fix-48374 branch January 24, 2023 21:16
@KristofferC KristofferC mentioned this pull request Feb 1, 2023
35 tasks
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard Crash: "Unreachable reached" when using the Subtyping Operator to compare against Union{<: T}
3 participants