Skip to content

Commit

Permalink
Delay .nextToken computation as per review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Nov 17, 2024
1 parent 089e42f commit a87a189
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,12 @@ object Parsers {
skipParams()
lookahead.isColon
&& {
lookahead.nextToken()
!sourceVersion.isAtLeast(`3.6`)
|| { // in the new given syntax, a `:` at EOL after an identifier represents a single identifier given
// Example:
// given C:
// def f = ...
lookahead.nextToken()
!lookahead.isAfterLineEnd
} || {
// Support for for pre-3.6 syntax where type is put on the next line
Expand Down

0 comments on commit a87a189

Please sign in to comment.