Skip to content

Commit f2a9eab

Browse files
committed
[CodeReview]
1 parent d732fc3 commit f2a9eab

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,7 @@ object Parsers {
24962496
}
24972497
else if (!isStatSep && (in.token != CASE)) {
24982498
exitOnError = mustStartStat
2499-
syntaxErrorOrIncomplete(IllegalStartOfStatement(isModifier = isModifier))
2499+
syntaxErrorOrIncomplete(IllegalStartOfStatement(isModifier))
25002500
}
25012501
acceptStatSepUnlessAtEnd(CASE)
25022502
}

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,12 +1882,10 @@ object messages {
18821882

18831883
case class IllegalStartOfStatement(isModifier: Boolean)(implicit ctx: Context) extends Message(IllegalStartOfStatementID) {
18841884
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."
18921890
}
18931891
}

compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,6 @@ class ErrorMessagesTests extends ErrorMessagesTest {
11401140
| { ) }
11411141
| { private ) }
11421142
|}
1143-
|
11441143
""".stripMargin
11451144
}
11461145
.expect { (ictx, messages) =>

0 commit comments

Comments
 (0)