Skip to content

misleading error for case class with leading using clause #15202

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

Closed
rmgk opened this issue May 17, 2022 · 1 comment · Fixed by #15382
Closed

misleading error for case class with leading using clause #15202

rmgk opened this issue May 17, 2022 · 1 comment · Fixed by #15382
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc good first issue Perfect for someone who wants to get started contributing itype:enhancement Spree Suitable for a future Spree

Comments

@rmgk
Copy link

rmgk commented May 17, 2022

Compiler version

At least 3.1.2 and 3.2.0-RC1-bin-20220514-bb29e20-NIGHTLY-git-bb29e20 (17.0.3, Java OpenJDK 64-Bit Server VM).

Minimized code

case class ACase(using Int)(normal: String)

Output

Error: A case class must have at least one non-implicit parameter list

Expectation

Either works using the first non-implicit argument list, or at least complains that it is not possible to have the first argument list implicit.

@rmgk rmgk added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 17, 2022
@bishabosha bishabosha added area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement Spree Suitable for a future Spree good first issue Perfect for someone who wants to get started contributing and removed itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 17, 2022
@bishabosha bishabosha changed the title Case class with first parameter list being implicit errors and with a misleading message misleading error for case class with leading using clause May 17, 2022
@bishabosha
Copy link
Member

Thanks for reporting!, the message should be clear that there is at least one non-implicit parameter list, and that it comes first

cgccuser added a commit to cgccuser/dotty that referenced this issue Jun 5, 2022
Closes scala#15202. Changes the message for case classes like `case class Foo(using Bar)(x: Baz)` from `Foo must have at least one non-implicit parameter list` to `must have at least one leading non-implicit parameter list`.
bishabosha pushed a commit to dotty-staging/dotty that referenced this issue Oct 18, 2022
Closes scala#15202. Changes the message for case classes like `case class Foo(using Bar)(x: Baz)` from `Foo must have at least one non-implicit parameter list` to `must have at least one leading non-implicit parameter list`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc good first issue Perfect for someone who wants to get started contributing itype:enhancement Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants