-
-
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 ambiguity error #20670
Comments
This is not a bug. |
Note that this is actually the first example given in the paramatric method section in the doc http://docs.julialang.org/en/latest/manual/methods.html#Parametric-Methods-1 . Not sure if we have a coherent definition and implementation of the dispatch yet but with jb/subtypes we are getting much closer on that. |
Sorry, I don't understand the explanation why this isn't a bug. What do you mean " |
And the fact that the "workaround" works is another bug #20056 (comment). |
I mean the |
The following on 0.5 and on master gives a method ambiguity error:
I do realize
f{T<:bar}(a::T, b::T) = 2
instead of justf(a::bar,b::bar)
is weird sincebar
is concrete, but strictly speaking its not wrong, hence I believe this is a bug.A weird workaround is to put instead,
which is redundant since subtyping
foo{T}
should guaranteeT<:Real
anyway, but nevertheless this seems to fix the problem.Tested on:
and
in which case some of the syntax in my example is changed to reflect 0.6.
The text was updated successfully, but these errors were encountered: