Skip to content

Commit 24bdb6e

Browse files
Fix error case EmptyTree span
1 parent 367acdd commit 24bdb6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,10 +3150,10 @@ object Parsers {
31503150
SubMatch(sel, cases)
31513151
case _ =>
31523152
syntaxErrorOrIncomplete(ExpectedTokenButFound(ARROW, tok))
3153-
EmptyTree
3153+
atSpan(self.span)(Block(Nil, EmptyTree))
31543154

31553155
val body = tok match
3156-
case ARROW => atSpan(in.skipToken()):
3156+
case ARROW => atSpan(in.skipToken()):
31573157
if exprOnly then
31583158
if in.indentSyntax && in.isAfterLineEnd && in.token != INDENT then
31593159
warning(em"""Misleading indentation: this expression forms part of the preceding catch case.

0 commit comments

Comments
 (0)