Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct method not called when adding one involving Type of Union #22792

Closed
rfourquet opened this issue Jul 13, 2017 · 2 comments
Closed

correct method not called when adding one involving Type of Union #22792

rfourquet opened this issue Jul 13, 2017 · 2 comments
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@rfourquet
Copy link
Member

Sorry for the bad title (I lack vocabulary on that topic, please edit it). It looks like a #265 problem:

julia> foo(::Type{<:Union{Int8,Int,UInt}}) = 1;

julia> foo(Union{Int,UInt})
1

julia> foo(::Union) = 2; 

julia> foo(Union{Int,UInt})
1

julia> foo(Union{Int8,UInt})
2

julia> foo(Union{Int,UInt}) # now works correctly
2
@vtjnash
Copy link
Member

vtjnash commented Jul 13, 2017

Likely the same as #11840

@JeffBezanson JeffBezanson added the types and dispatch Types, subtyping and method dispatch label Apr 4, 2018
@JeffBezanson
Copy link
Member

Seems to work now. The first method is always more specific, and 1 is always returned.

KristofferC added a commit that referenced this issue Apr 5, 2018
KristofferC added a commit that referenced this issue Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

3 participants