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
Perhaps I'm doing something funny here, but this came to a surprise to me:
julia> type A{T}
x::T
end
julia> typealias NumericA{T<:Number} A{T}
A{T<:Number}
julia> foo{T}(::NumericA{T}) = T
foo (generic function with 1 method)
julia> methods(foo)
#1 method for generic function "foo":
foo{T}(::A{T}) at none:1
julia> foo(A("bar"))
ASCIIString (constructor with 2 methods)
I would expect foo to only be defined for A{T<:Number}, not for all T.
The text was updated successfully, but these errors were encountered:
See also #2552, #6721
Currently the method parameter just "wins" and overrides the typealias parameter. typealias is just very problematic and I think the existing issues capture it.
Perhaps I'm doing something funny here, but this came to a surprise to me:
I would expect
foo
to only be defined forA{T<:Number}
, not for allT
.The text was updated successfully, but these errors were encountered: