File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
test/dotty/tools/dotc/reporting Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -2496,7 +2496,7 @@ object Parsers {
2496
2496
}
2497
2497
else if (! isStatSep && (in.token != CASE )) {
2498
2498
exitOnError = mustStartStat
2499
- syntaxErrorOrIncomplete(IllegalStartOfStatement (isModifier = isModifier ))
2499
+ syntaxErrorOrIncomplete(IllegalStartOfStatement (isModifier))
2500
2500
}
2501
2501
acceptStatSepUnlessAtEnd(CASE )
2502
2502
}
Original file line number Diff line number Diff line change @@ -1882,12 +1882,10 @@ object messages {
1882
1882
1883
1883
case class IllegalStartOfStatement (isModifier : Boolean )(implicit ctx : Context ) extends Message (IllegalStartOfStatementID ) {
1884
1884
val kind = " Syntax"
1885
- private val addendum = if (isModifier) " (no modifiers allowed here)" else " "
1886
- val msg = hl " Illegal start of statement $addendum"
1887
- val explanation = hl """
1888
- | Expected an import, a statement or an expression at the start of a statement.
1889
- | For a detailed list of allowed statements, please consult the syntax of BlockStat at http://dotty.epfl.ch/docs/internals/syntax.html#expressions
1890
- """
1891
-
1885
+ val msg = {
1886
+ val addendum = if (isModifier) " (no modifiers allowed here)" else " "
1887
+ hl " Illegal start of statement $addendum"
1888
+ }
1889
+ val explanation = hl " A statement is either an import, a definition or an expression. "
1892
1890
}
1893
1891
}
Original file line number Diff line number Diff line change @@ -1140,7 +1140,6 @@ class ErrorMessagesTests extends ErrorMessagesTest {
1140
1140
| { ) }
1141
1141
| { private ) }
1142
1142
|}
1143
- |
1144
1143
""" .stripMargin
1145
1144
}
1146
1145
.expect { (ictx, messages) =>
You can’t perform that action at this time.
0 commit comments