-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Method sorting bug #12580
Labels
types and dispatch
Types, subtyping and method dispatch
Comments
Note that this is fixed with #18457. I think this is a smaller repo (also fixed in #18457): # doesn't work on 0.5 (but works on jb/subtypes):
abstract AbstractMyType{T}
immutable MyType{T}<:AbstractMyType{T} end
tpara{A<:AbstractMyType}(::Type{A}) = (print(1); println(" ", A, " ", supertype(A)); tpara(supertype(A)))
tpara{I}(::Type{AbstractMyType{I}}) = (println(2); I)
tpara(MyType{true})
# julia> tpara(MyType{true})
# 1 MyType{true} AbstractMyType{true}
# 1 AbstractMyType{true} Any
# ERROR: MethodError: no method matching tpara(::Type{Any})
# Closest candidates are:
# tpara{A<:AbstractMyType{T}}(::Type{A<:AbstractMyType}) at REPL[3]:1
# tpara{I}(::Type{AbstractMyType{I}}) at REPL[4]:1
# in tpara(::Type{MyType{true}}) at ./REPL[3]:1
# works:
abstract AbstractMyType{T}
immutable MyType{T}<:AbstractMyType{T} end
tpara{I}(::Type{AbstractMyType{I}}) = (println(2); I) # swap method order to make it workL
tpara{A<:AbstractMyType}(::Type{A}) = (print(1); println(" ", A, " ", supertype(A)); tpara(supertype(A)))
tpara(MyType{true}) |
closed by #18457 |
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 17, 2017
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 17, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721 Enabled tests for JuliaLang#11840
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 17, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721 Enabled tests for JuliaLang#11840
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 17, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721 Enabled tests for JuliaLang#11840
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 18, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721 Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved yet but needs tests triggering it.
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 20, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#12721 For JuliaLang#11803 it was decidided that no tests are needed. Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved yet but needs new tests triggering it.
mauro3
added a commit
to mauro3/julia
that referenced
this issue
Jan 20, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#12721 For JuliaLang#11803 it was decidided that no tests are needed. Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved yet but needs new tests triggering it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With these types:
and these methods:
then
colortype(RGBA{Float32}) == RGB{Float32}
as desired. But in this order:it yields:
The text was updated successfully, but these errors were encountered: