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
A separate issue for @mbauman's #6383 (comment) which is distinct from the ambiguity problem.
julia> struct Foo{A<:Real} end
julia> f(x::Foo{A}) where A = 1
f (generic function with 1 method)
julia> f(x::Foo, y...) = 2
f (generic function with 2 methods)
julia> f(Foo{Int}())
2
The second method's 1-arg form appears (unless you're an Expert) as if it is less specific than the first. However, Foo is treated as Foo{T} where T<:Real, while the compiler puts a type bound of Any on A.
I think it would make sense if Foo{A} where A was treated as Foo{A} where A<:Real, at least in method definitions.