Skip to content

Commit 4cb50f1

Browse files
committed
Fix #7998: Treat ) as token that can end a statement
1 parent 9ab1842 commit 4cb50f1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ object Parsers {
194194
def isNumericLit = numericLitTokens contains in.token
195195
def isTemplateIntro = templateIntroTokens contains in.token
196196
def isDclIntro = dclIntroTokens contains in.token
197-
def isStatSeqEnd = in.isNestedEnd || in.token == EOF
197+
def isStatSeqEnd = in.isNestedEnd || in.token == EOF || in.token == RPAREN
198198
def mustStartStat = mustStartStatTokens contains in.token
199199

200200
/** Is current token a hard or soft modifier (in modifier position or not)? */

tests/pos/i7998.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@main def Test =
2+
(
3+
try 1
4+
catch
5+
case _: Throwable => 2
6+
)

0 commit comments

Comments
 (0)