-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
fix unsoundness in fieldtype of Tuple with non-Type params #40067
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
Conversation
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.
The server has been rebooted, so let's try once more: @nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Looks like all the failures are numeric issues, benchmark noise, etc. |
aca5554
to
3936c61
Compare
b115b2c
to
19e5060
Compare
84b0724
to
920992c
Compare
Could this be rebased on #40702? I am not sure what the replacements for |
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 tofieldtype
instead and give up on fixing it for <1.7.