Skip to content

Commit a87a189

Browse files
committed
Delay .nextToken computation as per review comment
1 parent 089e42f commit a87a189

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-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
@@ -1010,12 +1010,12 @@ object Parsers {
10101010
skipParams()
10111011
lookahead.isColon
10121012
&& {
1013-
lookahead.nextToken()
10141013
!sourceVersion.isAtLeast(`3.6`)
10151014
|| { // in the new given syntax, a `:` at EOL after an identifier represents a single identifier given
10161015
// Example:
10171016
// given C:
10181017
// def f = ...
1018+
lookahead.nextToken()
10191019
!lookahead.isAfterLineEnd
10201020
} || {
10211021
// Support for for pre-3.6 syntax where type is put on the next line

0 commit comments

Comments
 (0)