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

Ambiguous method callable #21963

Closed
martinholters opened this issue May 19, 2017 · 3 comments · Fixed by #21965
Closed

Ambiguous method callable #21963

martinholters opened this issue May 19, 2017 · 3 comments · Fixed by #21965
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@martinholters
Copy link
Member

Ref. #21892 (comment)

julia> methods(string, Tuple{Char})
# 1 method for generic function "string":
string(a::Union{Char, String}...) in Base at strings/string.jl:351

julia> Base.string(a::Union{Char, Val{:foo}}...) = "bar" # that's ambiguous!

julia> methods(string, Tuple{Char}) # let's check
# 0 methods for generic function "string":

julia> string('0') # so should throw MethodError
"0"
@martinholters
Copy link
Member Author

Looks like we were able to detect this ambiguity at some point in time: JuliaStrings/LegacyStrings.jl#8. Interstingly, even with 0.5.0, I don't get the MethodError reported there. @vtjnash do you remember what Julia version you were using (or how you got the MethodError thrown)?

@JeffBezanson JeffBezanson added the types and dispatch Types, subtyping and method dispatch label May 19, 2017
@vtjnash
Copy link
Member

vtjnash commented May 19, 2017

It's #265 :P (the method isn't getting flushed from the MethodTable cache)

I forget if I had hacked something, or just loaded other packages too.

@martinholters
Copy link
Member Author

Ah, silly me, I thought #265 had been closed. No, wait...

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