Skip to content

Commit f63ff90

Browse files
committed
Add @switch annotion in Scanner
1 parent 4c6f317 commit f63ff90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ object Scanners {
565565
lastOffset = prev.lastOffset
566566
lineOffset = prev.lineOffset
567567
}
568-
token match {
568+
(token: @switch) match {
569569
case CASE =>
570570
lookAhead()
571571
if (token == CLASS) fuse(CASECLASS)
@@ -601,8 +601,8 @@ object Scanners {
601601
if colonSyntax then observeColonEOL()
602602
case RBRACE | RPAREN | RBRACKET =>
603603
closeIndented()
604-
case EOF if !source.maybeIncomplete =>
605-
closeIndented()
604+
case EOF =>
605+
if !source.maybeIncomplete then closeIndented()
606606
case _ =>
607607
}
608608
}

0 commit comments

Comments
 (0)