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
This is similar to #3738 but it also affects positional arguments.
julia>test{T<:Number}(x::Union(Nothing, T)) =true
test (generic function with 1 method)
julia>test(1)
true
julia>test(nothing)
ERROR: no method test(Nothing)
The text was updated successfully, but these errors were encountered:
But it means unions with Nothing and any parametric type cannot be used, and in particular that Union(Nothing, AbstractArray{T}) with T<:Real does not work. This is annoying since there's no way of passing an equivalent of NULL for an argument. See my use case (but for keyword arguments) at https://groups.google.com/d/msg/julia-users/FAKPYxxiQgQ/VFW9l6-tqF8J
Wouldn't it be possible to call the method even if T is not specified, since nothing matches a type in the union?
This is similar to #3738 but it also affects positional arguments.
The text was updated successfully, but these errors were encountered: