fix unsoundness in fieldtype of Tuple with non-Type params#40067
Merged
fix unsoundness in fieldtype of Tuple with non-Type params#40067
Conversation
Member
|
Regardless of what we decide here for now, I believe fieldtype and first-parameter may eventually need to diverge somewhat to fix this mistake with the diagonal rule / covariance: julia> Tuple{Tuple{T, T}, Val{T}} where T
Tuple{Tuple{T, T}, Val{T}} where T
julia> fieldtype(ans, 1)
Tuple{T, T} where T # wrong: should be `Tuple{Any, Any}`
julia> ((1, 2.), Val{Any}()) isa Tuple{Tuple{T, T}, Val{T}} where T
true
julia> getfield(((1, 2.), Val{Any}()), 1) isa fieldtype(Tuple{Tuple{T, T}, Val{T}} where T, 1)
false |
a3a0794 to
aca5554
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Member
|
The server has been rebooted, so let's try once more: @nanosoldier |
Collaborator
|
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Member
Author
|
Looks like all the failures are numeric issues, benchmark noise, etc. |
aca5554 to
3936c61
Compare
b115b2c to
19e5060
Compare
84b0724 to
920992c
Compare
45 tasks
Member
|
Could this be rebased on #40702? I am not sure what the replacements for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is one way to fix #39988. The alternative is to make
fieldtype(Tuple{:x}, 1)returnUnion{}, which would be more consistent with other types. But, I'm assuming the default right thing is to make inference correct rather than change the value we return, so I'm trying this first. This version would be backportable for instance. But, if it causes problems (e.g. maybe too many new invalidations) we could just make the change tofieldtypeinstead and give up on fixing it for <1.7.