Skip to content

Commit dff5ade

Browse files
committed
Avoid lookahead in constrApps
1 parent 1c57fd8 commit dff5ade

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3483,12 +3483,11 @@ object Parsers {
34833483
val t = constrApp()
34843484
val ts =
34853485
if in.token == WITH then
3486-
val lookahead = in.LookaheadScanner(indent = true)
3487-
lookahead.nextToken()
3488-
if templateCanFollow && (lookahead.token == LBRACE || lookahead.token == INDENT) then
3486+
in.nextToken()
3487+
newLineOptWhenFollowedBy(LBRACE)
3488+
if templateCanFollow && (in.token == LBRACE || in.token == INDENT) then
34893489
Nil
34903490
else
3491-
in.nextToken()
34923491
checkNotWithAtEOL()
34933492
constrApps(commaOK, templateCanFollow)
34943493
else if commaOK && in.token == COMMA then

0 commit comments

Comments
 (0)