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

Arbitrary call priority when two methods differ only by presence of type parameter #19413

Closed
nalimilan opened this issue Nov 25, 2016 · 1 comment
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@nalimilan
Copy link
Member

In the following, the second test method does not overwrite the previous one despite actually accepting exactly the same argument types. Even more annoyingly, no method consistently takes precedence on the other: the method which is called is the first one which was used in the session. So the code below returns 1 as-is, and 2 when removing test(0) and running it in a new session.

test(x) = 1
test(0)
test{T}(x::T) = 2
test(0)

(Sorry if it's been reported elsewhere, I know similar issues are around but I couldn't find them.)

@kshyatt kshyatt added the types and dispatch Types, subtyping and method dispatch label Nov 30, 2016
@JeffBezanson
Copy link
Sponsor Member

closed by #18457 - These now will overwrite each other.

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