On Wed, 2016-10-12 at 20:49, Yichao Yu <yyc1...@gmail.com> wrote:
> On Wed, Oct 12, 2016 at 2:41 PM, Mauro <mauro...@runbox.com> wrote:
>> However, somewhat similar, this does not error:
>>
>> julia> g(x) = 1
>> g (generic function with 1 method)
>>
>> julia> g{X}(x::X) = 2
>> g (generic function with 2 methods)
>>
>> julia> g(4)
>> 2
>>
>> So here the parameterized method does seem more specific.
>>
>
> This is missing method overwite. i.e. a bug.

You mean the method-overwritten warning?  But it generates two methods,
so maybe it should go to the ambiguity error?

Also similar for two arguments:

julia> h(x,y) = 1
h (generic function with 1 method)

julia> h{X}(x::X,y) = 2
h (generic function with 2 methods)

julia> h{X,Y}(x::X,y::Y) = 3
h (generic function with 3 methods)

julia> h{Y}(x,y::Y) = 4
h (generic function with 4 methods)

julia> h(4,5)
2

I'll open an issue.

Reply via email to