Skip to content

missing method-ambiguity warning #11407

Closed
@yuyichao

Description

This is inspired by a newly poped up warning in PyCall

julia> type A{K, V}
       end

julia> type B{K, V}
       end

julia> f{K, V}(::A{K, V}, ::B{Any, V}) = 1
f (generic function with 1 method)

julia> f{K, V}(::A{K, V}, ::B{K, Any}) = 2
f (generic function with 2 methods)

julia> g{K, V}(::A{K, V}, ::B{K, Any}) = 2
g (generic function with 1 method)

julia> g{K, V}(::A{K, V}, ::B{Any, V}) = 1
g (generic function with 2 methods)

julia> a = A{Any, Any}()
A{Any,Any}()

julia> b = B{Any, Any}()
B{Any,Any}()

julia> f(a, b)
2

julia> g(a, b)
1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    help wantedIndicates that a maintainer wants help on an issue or pull requesttypes and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions