Misleading error message when trying to mix normal parameters and context parameters in the same parameter list
See original GitHub issueCompiler version
Welcome to Scala 3.1.3 (17.0.3, Java OpenJDK 64-Bit Server VM). Type in expressions for evaluation. Or try :help.
Minimized code and output
scala> def f(i: Int, using j: Int) = i + j
-- [E040] Syntax Error: ------------------------------------------
1 |def f(i: Int, using j: Int) = i + j
| ^
| ':' expected, but identifier found
Expectation
The compiler should point to the keyword using
and explain that mixing normal and context parameters is not allowed.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Fix common formatting issues for custom parameters
This article goes over how to format your custom parameters, and troubleshoot issues with how your tag was added to your site. It...
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >SML/NJ Error Messages
This document contains lists of error and warning messages produced by the SML/NJ Version 110 compiler, sorted alphabetically, with short explanations and ...
Read more >SQLSTATE values and common error codes - Db2 - IBM
A SELECT containing a non-ATOMIC data change statement successfully returned some rows, but one or more warnings or errors occurred. 0168B, An operation...
Read more >JUnit 5 Tutorial: Writing Parameterized Tests - Petri Kainulainen
That's why the provided arguments must use the same order as the method parameters of our test method. There are two things I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried a generic message
I’ll propose REPL rewrites soon as an experiment; perhaps it will automatically rewrite under
-rewrite
and otherwise just emit that there was a rewrite and stash on top of the history, so up-arrow fetches it. As with “helpful” help messages, it’s a fine line between being a chatty friend and the friend people ignore.In my opinion that’s a linter responsibility. Anyway this error has to change because as you stated, this is unhelpful to the end user.