-
-
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
Confusing MethodError for missing parameter #17319
Comments
Should the missing type parameter just be an error? I cant think of why it is useful |
That's not a bad solution. It may help to explain that the context this came up in was That said, I agree that an error would likely be an improvement over where we are now. |
@timholy I'd say raising an error should be the preferred way to report problems. If we start thinking that the user might miss some errors, then should we also accept invalid syntax and try to do something with it in the hope of printing a more helpful message later? :-) More general fix: make paste at the REPL stop at the first error. |
Good point, @nalimilan. I was just trying to think of a scenario in which the current behavior would be useful. |
Fixed by #23117 |
Deliberately create a method that's missing a static parameter:
Then:
Definitely confusing: that
foo
candidate sure looks like it matches, and the absence of any red text in the arguments, to indicate failure to match, seems to confirm that.For comparison, let's add another method:
For reproduction here, I've annotated any red text in the "closest candidates" with
!Matched
. (Note the method we want does not have!Matched
for any of its arguments.)The text was updated successfully, but these errors were encountered: