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

False ambiguity with Union #20246

Closed
timholy opened this issue Jan 26, 2017 · 5 comments · Fixed by #20982
Closed

False ambiguity with Union #20246

timholy opened this issue Jan 26, 2017 · 5 comments · Fixed by #20982
Labels
types and dispatch Types, subtyping and method dispatch
Milestone

Comments

@timholy
Copy link
Member

timholy commented Jan 26, 2017

julia> module A
       foo{T<:Union{Int,Int64}}(x::AbstractUnitRange{T}) = 1
       foo{T<:Union{UInt,UInt64}}(x::AbstractUnitRange{T}) = 2
       end
A

julia> Base.Test.detect_ambiguities(A)
1-element Array{Tuple{Method,Method},1}:
 (foo{T<:Int64}(x::AbstractUnitRange{T}) in A at REPL[10]:2,foo{T<:UInt64}(x::AbstractUnitRange{T}) in A at REPL[10]:3)
@timholy
Copy link
Member Author

timholy commented Jan 26, 2017

xref #19998

@yuyichao
Copy link
Contributor

I think this is why we want a version of ambiguity detection that ignores Union{}?

@Keno
Copy link
Member

Keno commented Jan 30, 2017

Yes

@timholy
Copy link
Member Author

timholy commented Mar 11, 2017

Assuming the goal is to restore the ambiguity tests before 0.6 is out, it's going to be necessary to fix this, so I added a milestone label.

@timholy
Copy link
Member Author

timholy commented Mar 11, 2017

Hmm, it looks like this was fixed in e101000, though it's not the default. Presumably we should either make it the default or change

@test_broken detect_ambiguities(Core, Base; imported=true) == []
to include allow_bottom=false?

EDIT: oh, I see, the fix is only partial.

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

Successfully merging a pull request may close this issue.

3 participants