Skip to content

Commit 366137d

Browse files
committed
Mark regions in parser that support old whitebox syntax
1 parent 8f4c8ed commit 366137d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ object Parsers {
3333
import reporting.Message
3434
import reporting.messages._
3535

36+
val AllowOldWhiteboxSyntax = true
37+
3638
case class OpInfo(operand: Tree, operator: Ident, offset: Offset)
3739

3840
class ParensCounters {
@@ -3253,7 +3255,7 @@ object Parsers {
32533255
case rparamss =>
32543256
leadingVparamss ::: rparamss
32553257
var tpt = fromWithinReturnType {
3256-
if in.token == SUBTYPE && mods.is(Inline) then
3258+
if in.token == SUBTYPE && mods.is(Inline) && AllowOldWhiteboxSyntax then
32573259
in.nextToken()
32583260
mods1 = addMod(mods1, Mod.Transparent())
32593261
toplevelTyp()
@@ -3522,7 +3524,7 @@ object Parsers {
35223524
accept(EQUALS)
35233525
mods1 |= Final
35243526
DefDef(name, tparams, vparamss, tpt, subExpr())
3525-
if in.token == USCORE then
3527+
if in.token == USCORE && AllowOldWhiteboxSyntax then
35263528
if !mods.is(Inline) then
35273529
syntaxError("`_ <:` is only allowed for given with `inline` modifier")
35283530
in.nextToken()

0 commit comments

Comments
 (0)