File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -1742,8 +1742,8 @@ object Parsers {
17421742 if (owner == nme.CONSTRUCTOR && (result.isEmpty || (result.head take 1 exists (_.mods is Implicit )))) {
17431743 in.token match {
17441744 case LBRACKET => syntaxError(" no type parameters allowed here" )
1745- case EOF => incompleteInputError(" auxiliary constructor needs non-implicit parameter list " )
1746- case _ => syntaxError(" auxiliary constructor needs non-implicit parameter list " , start)
1745+ case EOF => incompleteInputError(AuxConstructorNeedsNonImplicitParameter () )
1746+ case _ => syntaxError(AuxConstructorNeedsNonImplicitParameter () , start)
17471747 }
17481748 }
17491749 result
Original file line number Diff line number Diff line change @@ -715,4 +715,21 @@ object messages {
715715 | """ .stripMargin
716716 }
717717 }
718+
719+ case class AuxConstructorNeedsNonImplicitParameter ()(implicit ctx: Context ) extends Message (26 ) {
720+ val kind = " Syntax"
721+ val msg = " auxiliary constructor needs non-implicit parameter list"
722+ val explanation =
723+ hl """ Only the primary constructor is allowed an ${" implicit" } parameter list;
724+ |auxiliary constructors need a non-implicit parameter list. When a primary
725+ |constructor has an implicit argslist, auxiliary constructors that call the
726+ |primary constructor must specify the implicit value.
727+ |
728+ |To resolve this issue check for:
729+ | - forgotten parenthesis on ${" this" } ( ${" def this() = // ..." })
730+ | - auxiliary constructors specify the implicit value
731+ | """ .stripMargin
732+ }
733+
734+
718735}
You can’t perform that action at this time.
0 commit comments