Skip to content

Commit 1942071

Browse files
committed
improve wording and make styling consistent
1 parent e216df8 commit 1942071

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,18 +1773,15 @@ object messages {
17731773
case class EnumCaseDefinitionInNonEnumOwner(owner: Symbol)(implicit ctx: Context)
17741774
extends Message(EnumCaseDefinitionInNonEnumOwnerID) {
17751775
val kind = "Syntax"
1776-
val msg = em"case not allowed here, since owner ${owner} is not an `enum' object"
1776+
val msg = em"case not allowed here, since owner `${owner}` is not an `${"enum"}` object"
17771777
val explanation = {
17781778

17791779
hl"""
1780-
| ${"case"} is only allowed at this place if the surrounding object is the companion object of an `enum class`.
1781-
| If you wanted to create an enumeration make sure that the corresponding class has the `enum` keyword.
1782-
| Otherwise you might have forgotten `class` or `object` after this `enum`.
1780+
| `${"case"}` is only allowed at this place if the surrounding object is the companion object of an `${"enum"} ${"class"}`.
1781+
| If you wanted to create an enumeration make sure that the corresponding class has the `${"enum"}` keyword.
1782+
| Otherwise you might have forgotten `${"class"}` or `${"object"}` after this `${"case"}` here.
17831783
|
1784-
| See http://dotty.epfl.ch/docs/reference/enums/enums.html for more details on enumerations.
17851784
""".stripMargin
17861785
}
1787-
17881786
}
1789-
17901787
}

0 commit comments

Comments
 (0)