-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unclear "... must be called with () argument" error message #17123
Labels
area:reporting
Error reporting including formatting, implicit suggestions, etc
Milestone
Comments
dsbos
added
the
stat:needs triage
Every issue needs to have an "area" and "itype" label
label
Mar 17, 2023
Scala 2 has the same issue, and also incorrectly predicts what Scala 3 would do. Related Scala 3 ticket on position (for missing givens) and PR to avoid pointing the caret to outer space. I like a message that shows me what to write, like this related Scala 2 message:
|
nicolasstucki
added
area:reporting
Error reporting including formatting, implicit suggestions, etc
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Mar 17, 2023
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 17, 2023
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 17, 2023
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 3, 2023
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 3, 2023
nicolasstucki
added a commit
that referenced
this issue
Apr 3, 2023
Dedelweiss
pushed a commit
to Dedelweiss/dotty
that referenced
this issue
Apr 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.2.2
Minimized example
Output
Note how the error message says that the method needs to be called with an empty argument list, even though the method is called with an empty argument list.
(Yes, I know that the real problem is that it needs a second empty argument list too, but the error message doesn't say or hint at that, and therefore is confusing.)
Expectation
Better error message wording and/or structure.
Maybe refer to the partial call
m()
instead of referring to just methodm
when saying that something must be called with a()
argument list.Maybe say something like "call to
m
must be called with a(nother)()
argument."Also, report the column number consistently. When the first (empty) argument list is missing, the column number points to where the list is missing (the column after
m
), but when a second or later (argument) list is missing, the column number points into the middle of the last present argument list, not pointing to where something it missing.The text was updated successfully, but these errors were encountered: