Skip to content

Commit

Permalink
Merge pull request #15382 from cgccuser/case-class-params-msg
Browse files Browse the repository at this point in the history
Case class must have at least one *leading* non-implicit parameter list
  • Loading branch information
prolativ authored Jun 6, 2022
2 parents e71fe80 + 16b694d commit cec9aa3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2344,12 +2344,12 @@ import transform.SymUtils._
class CaseClassMissingNonImplicitParamList(cdef: untpd.TypeDef)(using Context)
extends SyntaxMsg(CaseClassMissingNonImplicitParamListID) {
def msg =
em"""|A ${hl("case class")} must have at least one non-implicit parameter list"""
em"""|A ${hl("case class")} must have at least one leading non-implicit parameter list"""

def explain =
em"""|${cdef.name} must have at least one non-implicit parameter list,
em"""|${cdef.name} must have at least one leading non-implicit parameter list,
| if you're aiming to have a case class parametrized only by implicit ones, you should
| add an explicit ${hl("()")} as a parameter list to ${cdef.name}.""".stripMargin
| add an explicit ${hl("()")} as the first parameter list to ${cdef.name}.""".stripMargin
}

class EnumerationsShouldNotBeEmpty(cdef: untpd.TypeDef)(using Context)
Expand Down

0 comments on commit cec9aa3

Please sign in to comment.