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

Make isdispatchtuple consistent for typeof(Union{}) #45348

Merged
merged 1 commit into from
May 22, 2022

Conversation

Keno
Copy link
Member

@Keno Keno commented May 18, 2022

We have typeof(Union{}) == Type{Union{}}, but were treating them
differently in the calculation of isdispatchtuple. The compiler
expects isdispatchtuple to commute with type equality in various
places, so try to make this consistent.

Fixes #45347

We have `typeof(Union{}) == Type{Union{}}`, but were treating them
differently in the calculation of `isdispatchtuple`. The compiler
expects `isdispatchtuple` to commute with type equality in various
places, so try to make this consistent.

Fixes #45347
@Keno Keno requested review from vtjnash and JeffBezanson May 18, 2022 01:56
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

We also may be incorrectly failing to normalize this type correctly, since we have

julia> typeof((Union{},)) == Tuple{Type{Union{}}}
true

julia> typeof((Union{},)) === Tuple{Type{Union{}}}
false

julia> typeof((Union{},))
Tuple{Core.TypeofBottom}

Which also violates our assumptions.

@Keno Keno merged commit a37dd16 into master May 22, 2022
@Keno Keno deleted the kf/isdispatchtupleunion branch May 22, 2022 19:00
pchintalapudi pushed a commit that referenced this pull request May 25, 2022
We have `typeof(Union{}) == Type{Union{}}`, but were treating them
differently in the calculation of `isdispatchtuple`. The compiler
expects `isdispatchtuple` to commute with type equality in various
places, so try to make this consistent.

Fixes #45347
@aviatesk aviatesk added the backport 1.8 Change should be backported to release-1.8 label May 27, 2022
KristofferC pushed a commit that referenced this pull request May 28, 2022
We have `typeof(Union{}) == Type{Union{}}`, but were treating them
differently in the calculation of `isdispatchtuple`. The compiler
expects `isdispatchtuple` to commute with type equality in various
places, so try to make this consistent.

Fixes #45347

(cherry picked from commit a37dd16)
@KristofferC KristofferC mentioned this pull request May 28, 2022
36 tasks
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isdispatchtuple inconsistency for typeof(Union{})
4 participants