We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9396006 + c44b993 commit fec3ec3Copy full SHA for fec3ec3
src/dotty/tools/dotc/parsing/Parsers.scala
@@ -2046,7 +2046,10 @@ object Parsers {
2046
else if (in.token == AT || isTemplateIntro || isModifier)
2047
stats += tmplDef(in.offset, defAnnotsMods(modifierTokens))
2048
else if (!isStatSep) {
2049
- syntaxErrorOrIncomplete("expected class or object definition")
+ if (in.token == CASE)
2050
+ syntaxErrorOrIncomplete("only `case class` or `case object` allowed")
2051
+ else
2052
+ syntaxErrorOrIncomplete("expected class or object definition")
2053
if (mustStartStat) // do parse all definitions even if they are probably local (i.e. a "}" has been forgotten)
2054
defOrDcl(in.offset, defAnnotsMods(modifierTokens))
2055
}
0 commit comments