type normalization: Union{Tuple{}, Tuple{Int64, Vararg{Int64, N}} where {N}}
into Tuple{Vararg{Int64}}
?
#56732
Labels
feature
Indicates new feature / enhancement requests
types and dispatch
Types, subtyping and method dispatch
PR #55123 introduced normalization of types like
Union{Tuple{}, Tuple{Int64, Vararg{Int64}}}
intoTuple{Vararg{Int64}}
. The motivation was making subtyping more precise, helping inference, xref #54746.This was great, however it seems incomplete: in the above
Union
, replacingTuple{Int64, Vararg{Int64}}
with the equal typeTuple{Int64, Vararg{Int64, N}} where {N}
prevents this normalization from occuring, also resulting in some unexpected subtyping behavior:This results in bad inference in PR #56731 (buildkite CI link):
I think one way of fixing it would be to normalizeKeno explains this can't work.Tuple{Int64, Vararg{Int64, N}} where {N}
intoTuple{Int64, Vararg{Int64}}
. Does that sound doable?The text was updated successfully, but these errors were encountered: