You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following "poor man's typesubtract" does not work:
julia>f(::Type{Union{T,S}}, ::Type{T}) where {S, T} = S
f (generic function with 1 method)
julia>f(Union{Missing, Float64, Int}, Missing)
ERROR: MethodError: no method matching f(::Type{Union{Missing, Float64, Int64}}, ::Type{Missing})
Closest candidates are:f(::Type{Union{T, S}}, ::Type{T}) where {S, T} at REPL[2]:1
Stacktrace:
[1] top-level scope at REPL[3]:1
However, it works when the order of arguments is reversed:
julia>g(::Type{T}, ::Type{Union{T,S}}) where {S, T} = S
g (generic function with 1 method)
julia>g(Missing, Union{Missing, Float64, Int})
Union{Float64, Int64}
I checked it with 1.2.0-DEV.146. I also noticed that both of them work with 0.6.4. This could be a duplicate of #26135 and #24333. But since none of them mention the order of arguments, I post it just in case.
The text was updated successfully, but these errors were encountered:
Originally discussed in: https://discourse.julialang.org/t/19732/5
Following "poor man's
typesubtract
" does not work:However, it works when the order of arguments is reversed:
I checked it with 1.2.0-DEV.146. I also noticed that both of them work with 0.6.4. This could be a duplicate of #26135 and #24333. But since none of them mention the order of arguments, I post it just in case.
The text was updated successfully, but these errors were encountered: