-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
type promotion of missing inside tuples #31077
Comments
Duplicate of #25925? |
This has nothing do to with inference, it's a matter of promotion: julia> Base.promote_typeof(("A", 3), ("B", missing))
Tuple{String,Any}
julia> Base.promote_typeof(3, missing)
Union{Missing, Int64} We don't have a specific |
AFAICT that's #25924. TBH I'm still not sure why it was rejected... |
@JeffBezanson wrote on #25924 (a specific implementation of #25925?)
I think |
As noted by @martinholters, #25925 is different since it's only about inference. Here you're talking about the actual type of the result (for which inference isn't involved at all contrary to what you wrote in the description). |
So, this is a duplicate (or perhaps special case) of #25924 which is rejected. I'm coming at this from a user perspective, and I see two conflicting desires: (a) recommending
|
This is a low-priority feature request. Within a
Vector{Tuple}
andVector{NamedTuple}
, Julia does not infer the presence ofmissing
values to mean aUnion{Missing, T}
data type as it does within a plainVector
. A more specific type inference would be more helpful.Within a plain vector or tuple,
Union{Missing, T}
is inferred.Without
missing
inference within a vector of tuples is specific:Hence, combining these two precedents, I would prefer to see the following type inference:
The text was updated successfully, but these errors were encountered: