-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
missing dataBase.missing and related functionalityBase.missing and related functionalitytypes and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch
Description
This should be the more confined example of the bug that hit JuliaData/WeakRefStrings.jl#20 on Julia nightly (Julia 0.7.0-DEV.3018):
julia> foo(A::Array{T}) where {T} = @show T eltype(A)
foo (generic function with 1 method)
julia> bar(A::Array{T}) where {T <: Union{Integer, Missing}} = @show T eltype(A)
bar (generic function with 1 method)
julia> bar2(A::Array{T}) where {T <: Union{Int, Missing}} = @show T eltype(A)
bar2 (generic function with 1 method)
julia> foo([1, missing])
T = Union{Missing, Int64}
eltype(A) = Union{Missing, Int64}
Union{Missing, Int64}
julia> bar([1, missing])
T = Int64
eltype(A) = Union{Missing, Int64}
Union{Missing, Int64}
julia> bar2([1, missing])
T = Union{Missing, Int64}
eltype(A) = Union{Missing, Int64}
Union{Missing, Int64}For some reason T===Int instead of T=Union{Int, Missing} inside bar().
Metadata
Metadata
Assignees
Labels
missing dataBase.missing and related functionalityBase.missing and related functionalitytypes and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch