-
-
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
Parameterized methods can shadow other method without error/warning #18892
Comments
Yes, #8974 will provide a definitive type equality test that will allow these method overwrites to happen. |
closed by #18457 |
This is still an issue, since type-equal is not the same as sig-equal due to the extra parameters-must-match rule. That can cause us to incorrectly delete a method that may still be needed, or replace a method with one that is not equivalent (mostly resulting from Varargs). |
Closing in favor of #21026, which is more specifically about that. |
Parameterized methods are more specific than non-parameterized ones:
I don't think there is any way to call the first method of
g
.Similarly for several arguments:
One solution is to consider above methods ambiguous and throw
MethodError ... is ambiguous.
on call. Another solution is to make those method definitions overwrite the previous one. Probably should be in sync with #8974.X-ref: https://groups.google.com/d/msg/julia-users/-ldkZlbg76Q/pYRNT4eIBAAJ
The text was updated successfully, but these errors were encountered: