File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -1711,10 +1711,11 @@ object Parsers {
17111711 })
17121712 else if in.isIdent(nme.UPARROW )
17131713 && (in.lookahead.token == LBRACE
1714- || ! canStartInfixTypeTokens.contains(in.lookahead.token))
1714+ || ! canStartInfixTypeTokens.contains(in.lookahead.token)
1715+ || in.lookahead.lineOffset > 0 )
17151716 // Disambiguation: a `^` is treated as a postfix operator meaning `^{any}`
1716- // if followed by `{` or newline, or any other token that cannot start
1717- // an infix type. Otherwise it is treated as an infix operator.
1717+ // if followed by `{` or a new line (significant or not), or a token that
1718+ // cannot start an infix type. Otherwise it is treated as an infix operator.
17181719 then
17191720 val upArrowStart = in.offset
17201721 in.nextToken()
Original file line number Diff line number Diff line change 1+ object Test :
2+ var x = 0
3+ type FreshContext = String ^
4+ x += 1
5+
6+ inline def ctx (using c : String ) = c
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ abstract class Ctx:
8383 def run : Run
8484 def detached : DetachedContext
8585
86- type Context = { * } Ctx
86+ type Context = Ctx ^
8787
8888abstract class DetachedContext extends Ctx :
8989 def outer : DetachedContext
@@ -110,9 +110,9 @@ object NoContext extends FreshCtx(-1):
110110 owner = NoSymbol
111111 scope = EmptyScope
112112
113- type FreshContext = { * } FreshCtx
113+ type FreshContext = FreshCtx ^
114114
115- inline def ctx (using c : Context ): {c} Ctx = c
115+ inline def ctx (using c : Context ): Ctx ^ {c} = c
116116
117117// !cc! it does not work if ctxStack is an Array[FreshContext] instead.
118118var ctxStack = Array .tabulate(16 )(new FreshCtx (_))
You can’t perform that action at this time.
0 commit comments