-
-
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
which() reports "no method found" when there is an ambiguity #22988
Comments
Ambiguities are method errors: a method matches by definition only if it is the unique most specific method matching the argument types. |
Yet there is the |
Yeah, I agree that an error should be thrown when there is an ambiguity, but it should say that there is (or may be) an ambiguity, not that there is no method. It is very confusing when there is a matching method right in front of you and it says no method found. |
A quick and dirty fix would be to make the error say "no unique method match for the specified argument types" and to get rid of the unreachable "method match is ambiguous..." error. Then there would be no distinction between the two types of failures, but the error message would not be as misleading. |
I believe the following behavior of
which()
is not intended:Instead of saying that there is "no method found",
which()
should give an error indicating that there is an ambiguity. Looking at the sourcejulia/base/reflection.jl
Line 878 in 2b983d4
I think it's worth fixing or changing the error to say that it might be an ambiguity because it was quite confusing to me when debugging.
Sorry if this is a duplicate issue - it's not too easy to search for issues involving "which".
Also, my
versioninfo()
:The text was updated successfully, but these errors were encountered: