Skip to content

Commit 8f4324c

Browse files
committed
Disable old context function syntax
1 parent fc8f8fb commit 8f4324c

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,10 +1904,7 @@ object Parsers {
19041904

19051905
def expr(location: Location): Tree = {
19061906
val start = in.offset
1907-
def isSpecialClosureStart =
1908-
val lookahead = in.LookaheadScanner()
1909-
lookahead.nextToken()
1910-
lookahead.isIdent(nme.using) || lookahead.token == ERASED
1907+
def isSpecialClosureStart = in.lookahead.token == ERASED
19111908
if in.token == IMPLICIT then
19121909
closure(start, location, modifiers(BitSet(IMPLICIT)))
19131910
else if in.token == LPAREN && isSpecialClosureStart then
@@ -2137,9 +2134,7 @@ object Parsers {
21372134
else
21382135
openParens.change(LPAREN, 1)
21392136
var mods1 = mods
2140-
if mods.flags.isEmpty then
2141-
if isIdent(nme.using) then mods1 = addMod(mods1, atSpan(in.skipToken()) { Mod.Given() })
2142-
if in.token == ERASED then mods1 = addModifier(mods1)
2137+
if in.token == ERASED then mods1 = addModifier(mods1)
21432138
try
21442139
commaSeparated(() => binding(mods1))
21452140
finally
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
val test =
2+
(using x: Int) => x // error // error

0 commit comments

Comments
 (0)