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 {
1711
1711
})
1712
1712
else if in.isIdent(nme.UPARROW )
1713
1713
&& (in.lookahead.token == LBRACE
1714
- || ! canStartInfixTypeTokens.contains(in.lookahead.token))
1714
+ || ! canStartInfixTypeTokens.contains(in.lookahead.token)
1715
+ || in.lookahead.lineOffset > 0 )
1715
1716
// 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.
1718
1719
then
1719
1720
val upArrowStart = in.offset
1720
1721
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:
83
83
def run : Run
84
84
def detached : DetachedContext
85
85
86
- type Context = { * } Ctx
86
+ type Context = Ctx ^
87
87
88
88
abstract class DetachedContext extends Ctx :
89
89
def outer : DetachedContext
@@ -110,9 +110,9 @@ object NoContext extends FreshCtx(-1):
110
110
owner = NoSymbol
111
111
scope = EmptyScope
112
112
113
- type FreshContext = { * } FreshCtx
113
+ type FreshContext = FreshCtx ^
114
114
115
- inline def ctx (using c : Context ): {c} Ctx = c
115
+ inline def ctx (using c : Context ): Ctx ^ {c} = c
116
116
117
117
// !cc! it does not work if ctxStack is an Array[FreshContext] instead.
118
118
var ctxStack = Array .tabulate(16 )(new FreshCtx (_))
You can’t perform that action at this time.
0 commit comments