Skip to content

Commit 7913391

Browse files
committed
Rename caps.Root to caps.Cap
1 parent 114c8f0 commit 7913391

31 files changed

+49
-49
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ extension (sym: Symbol)
369369
/** The owner of the current level. Qualifying owners are
370370
* - methods other than constructors and anonymous functions
371371
* - anonymous functions, provided they either define a local
372-
* root of type caps.Root, or they are the rhs of a val definition.
372+
* root of type caps.Cap, or they are the rhs of a val definition.
373373
* - classes, if they are not staticOwners
374374
* - _root_
375375
*/
@@ -397,19 +397,19 @@ extension (sym: Symbol)
397397
def setNestingLevel(level: Int)(using Context): Unit =
398398
ccState.nestingLevels(sym) = level
399399

400-
/** The parameter with type caps.Root in the leading term parameter section,
400+
/** The parameter with type caps.Cap in the leading term parameter section,
401401
* or NoSymbol, if none exists.
402402
*/
403403
def definedLocalRoot(using Context): Symbol =
404404
sym.paramSymss.dropWhile(psyms => psyms.nonEmpty && psyms.head.isType) match
405-
case psyms :: _ => psyms.find(_.info.typeSymbol == defn.Caps_Root).getOrElse(NoSymbol)
405+
case psyms :: _ => psyms.find(_.info.typeSymbol == defn.Caps_Cap).getOrElse(NoSymbol)
406406
case _ => NoSymbol
407407

408408
def localRoot(using Context): Symbol =
409409
val owner = sym.levelOwner
410410
assert(owner.exists)
411411
def newRoot = newSymbol(if owner.isClass then newLocalDummy(owner) else owner,
412-
nme.LOCAL_CAPTURE_ROOT, Synthetic, defn.Caps_Root.typeRef, nestingLevel = owner.ccNestingLevel)
412+
nme.LOCAL_CAPTURE_ROOT, Synthetic, defn.Caps_Cap.typeRef, nestingLevel = owner.ccNestingLevel)
413413
def lclRoot =
414414
if owner.isTerm then owner.definedLocalRoot.orElse(newRoot)
415415
else newRoot

compiler/src/dotty/tools/dotc/cc/CaptureRoot.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object CaptureRoot:
4242

4343
def computeHash(bs: Binders): Int = hash
4444
def hash: Int = System.identityHashCode(this)
45-
def underlying(using Context): Type = defn.Caps_Root.typeRef
45+
def underlying(using Context): Type = defn.Caps_Cap.typeRef
4646
end Var
4747

4848
def isEnclosingRoot(c1: CaptureRoot, c2: CaptureRoot)(using Context): Boolean =

compiler/src/dotty/tools/dotc/cc/CaptureSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ object CaptureSet:
968968
case tp: TermParamRef =>
969969
tp.captureSet
970970
case tp: TypeRef =>
971-
if tp.typeSymbol == defn.Caps_Root then universal else empty
971+
if tp.typeSymbol == defn.Caps_Cap then universal else empty
972972
case _: TypeParamRef =>
973973
empty
974974
case CapturingType(parent, refs: RefiningVar) =>

compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ class CheckCaptures extends Recheck, SymTransformer:
11511151
for case ref: TermParamRef <- elems do
11521152
if !allowed.contains(ref) && !seen.contains(ref) then
11531153
seen += ref
1154-
if ref.underlying.isRef(defn.Caps_Root) then
1154+
if ref.underlying.isRef(defn.Caps_Cap) then
11551155
report.error(i"escaping local reference $ref", tree.srcPos)
11561156
else
11571157
val widened = ref.captureSetOfInfo

compiler/src/dotty/tools/dotc/cc/Setup.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ extends tpd.TreeTraverser:
318318
return
319319
inContext(ctx.withOwner(tree.symbol)):
320320
if tree.symbol.isAnonymousFunction && tree.symbol.definedLocalRoot.exists then
321-
// closures that define parameters of type caps.Root count as level owners
321+
// closures that define parameters of type caps.Cap count as level owners
322322
tree.symbol.setNestingLevel(ctx.owner.nestingLevel + 1)
323323
tree.tpt match
324324
case tpt: TypeTree if tree.symbol.allOverriddenSymbols.hasNext =>
@@ -518,7 +518,7 @@ extends tpd.TreeTraverser:
518518
// we assume Any is a shorthand of {cap} Any, so if Any is an upper
519519
// bound, the type is taken to be impure.
520520
else
521-
sym != defn.Caps_Root && superTypeIsImpure(tp.superType)
521+
sym != defn.Caps_Cap && superTypeIsImpure(tp.superType)
522522
case tp: (RefinedOrRecType | MatchType) =>
523523
superTypeIsImpure(tp.underlying)
524524
case tp: AndType =>

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ class Definitions {
971971

972972
@tu lazy val CapsModule: Symbol = requiredModule("scala.caps")
973973
@tu lazy val captureRoot: TermSymbol = CapsModule.requiredValue("cap")
974-
@tu lazy val Caps_Root: TypeSymbol = CapsModule.requiredType("Root")
974+
@tu lazy val Caps_Cap: TypeSymbol = CapsModule.requiredType("Cap")
975975
@tu lazy val CapsUnsafeModule: Symbol = requiredModule("scala.caps.unsafe")
976976
@tu lazy val Caps_unsafeAssumePure: Symbol = CapsUnsafeModule.requiredMethod("unsafeAssumePure")
977977
@tu lazy val Caps_unsafeBox: Symbol = CapsUnsafeModule.requiredMethod("unsafeBox")

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ object Types {
29302930
if name == nme.LOCAL_CAPTURE_ROOT then
29312931
if symbol.owner.isLocalDummy then symbol.owner.owner
29322932
else symbol.owner
2933-
else if info.isRef(defn.Caps_Root) then
2933+
else if info.isRef(defn.Caps_Cap) then
29342934
val owner = symbol.maybeOwner
29352935
if owner.isTerm then owner else NoSymbol
29362936
else NoSymbol

library/src/scala/caps.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import annotation.experimental
44

55
@experimental object caps:
66

7-
opaque type Root = Unit
7+
opaque type Cap = Unit
88

99
/** The universal capture reference (deprecated) */
1010
@deprecated("Use `cap` instead")
11-
val `*`: Root = ()
11+
val `*`: Cap = ()
1212

1313
/** The universal capture reference */
14-
val cap: Root = ()
14+
val cap: Cap = ()
1515

16-
given Root = cap
16+
given Cap = cap
1717

1818
object unsafe:
1919

tests/neg-custom-args/captures/capt-test.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def raise[E <: Exception](e: E): Nothing throws E = throw e
1414
def foo(x: Boolean): Int throws Fail =
1515
if x then 1 else raise(Fail())
1616

17-
def handle[E <: Exception, R <: Top](op: (lcap: caps.Root) ?-> (CT[E] @retains(lcap)) => R)(handler: E => R): R =
17+
def handle[E <: Exception, R <: Top](op: (lcap: caps.Cap) ?-> (CT[E] @retains(lcap)) => R)(handler: E => R): R =
1818
val x: CT[E] = ???
1919
try op(x)
2020
catch case ex: E => handler(ex)

tests/neg-custom-args/captures/cc-this2.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
-- Error: tests/neg-custom-args/captures/cc-this2/D_2.scala:2:6 --------------------------------------------------------
33
2 |class D extends C: // error
44
|^
5-
|reference (cap : caps.Root) is not included in the allowed capture set {} of pure base class class C
5+
|reference (cap : caps.Cap) is not included in the allowed capture set {} of pure base class class C
66
3 | this: D^ =>

tests/neg-custom-args/captures/exception-definitions.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/neg-custom-args/captures/exception-definitions.scala:2:6 -----------------------------------------------
22
2 |class Err extends Exception: // error
33
|^
4-
|reference (cap : caps.Root) is not included in the allowed capture set {} of pure base class class Throwable
4+
|reference (cap : caps.Cap) is not included in the allowed capture set {} of pure base class class Throwable
55
3 | self: Err^ =>
66
-- Error: tests/neg-custom-args/captures/exception-definitions.scala:7:12 ----------------------------------------------
77
7 | val x = c // error

tests/neg-custom-args/captures/filevar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Service:
88
var file: File^ = uninitialized
99
def log = file.write("log")
1010

11-
def withFile[T](op: (l: caps.Root) ?-> (f: File^{l}) => T): T =
11+
def withFile[T](op: (l: caps.Cap) ?-> (f: File^{l}) => T): T =
1212
op(new File)
1313

1414
def test =

tests/neg-custom-args/captures/heal-tparam-cs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import language.experimental.captureChecking
22

33
trait Cap { def use(): Unit }
44

5-
def localCap[T](op: (lcap: caps.Root) ?-> (c: Cap^{lcap}) => T): T = ???
5+
def localCap[T](op: (lcap: caps.Cap) ?-> (c: Cap^{lcap}) => T): T = ???
66

77
def main(io: Cap^{cap}, net: Cap^{cap}): Unit = {
88

tests/neg-custom-args/captures/i15049.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Session:
22
def request = "Response"
33
class Foo:
44
private val session: Session^{cap} = new Session
5-
def withSession[T](f: (local: caps.Root) ?-> (Session^{local}) => T): T = f(session)
5+
def withSession[T](f: (local: caps.Cap) ?-> (Session^{local}) => T): T = f(session)
66

77
def Test: Unit =
88
val f = new Foo

tests/neg-custom-args/captures/i15772.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
| Found: box C^{cap[c]}
2929
| Required: box C{val arg: C^?}^?
3030
|
31-
| Note that reference (cap[c] : caps.Root), defined at level 2
31+
| Note that reference (cap[c] : caps.Cap), defined at level 2
3232
| cannot be included in outer capture set ?, defined at level 1 in method main3
3333
|
3434
| longer explanation available when compiling with `-explain`
@@ -38,7 +38,7 @@
3838
| Found: C^{cap[c]}
3939
| Required: C^{'cap[..main3](from instantiating unsafe)}
4040
|
41-
| Note that reference (cap[c] : caps.Root), defined at level 2
41+
| Note that reference (cap[c] : caps.Cap), defined at level 2
4242
| cannot be included in outer capture set ?, defined at level 1 in method main3
4343
|
4444
| longer explanation available when compiling with `-explain`
@@ -48,7 +48,7 @@
4848
| Found: () ->{x} Unit
4949
| Required: () -> Unit
5050
|
51-
| Note that reference (cap[c] : caps.Root), defined at level 2
51+
| Note that reference (cap[c] : caps.Cap), defined at level 2
5252
| cannot be included in outer capture set ?, defined at level 1 in method main3
5353
|
5454
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/captures/i15923.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type Id[X] = [T] -> (op: X => T) -> T
33
def mkId[X](x: X): Id[X] = [T] => (op: X => T) => op(x)
44

55
def bar() = {
6-
def withCap[X](op: (lcap: caps.Root) ?-> Cap^{lcap} => X): X = {
6+
def withCap[X](op: (lcap: caps.Cap) ?-> Cap^{lcap} => X): X = {
77
val cap: Cap = new Cap { def use() = { println("cap is used"); 0 } }
88
val result = op(cap)
99
result

tests/neg-custom-args/captures/lazylists-exceptions.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
| Found: LazyList[Int]^
55
| Required: LazyList[Int]^?
66
|
7-
| Note that reference (cap : caps.Root), defined at level 2
7+
| Note that reference (cap : caps.Cap), defined at level 2
88
| cannot be included in outer capture set ?, defined at level 1 in method problem
99
38 | if i > 9 then throw Ex1()
1010
39 | i * i

tests/neg-custom-args/captures/real-try.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
| Found: () => Unit
1111
| Required: () ->? Unit
1212
|
13-
| Note that reference (cap : caps.Root), defined at level 2
13+
| Note that reference (cap : caps.Cap), defined at level 2
1414
| cannot be included in outer capture set ?, defined at level 1 in method test
1515
|
1616
| longer explanation available when compiling with `-explain`
@@ -20,7 +20,7 @@
2020
| Found: () => Cell[Unit]^?
2121
| Required: () ->? Cell[Unit]^?
2222
|
23-
| Note that reference (cap : caps.Root), defined at level 2
23+
| Note that reference (cap : caps.Cap), defined at level 2
2424
| cannot be included in outer capture set ?, defined at level 1 in method test
2525
|
2626
| longer explanation available when compiling with `-explain`
@@ -30,7 +30,7 @@
3030
| Found: Cell[box () => Unit]^?
3131
| Required: Cell[() ->? Unit]^?
3232
|
33-
| Note that reference (cap : caps.Root), defined at level 2
33+
| Note that reference (cap : caps.Cap), defined at level 2
3434
| cannot be included in outer capture set ?, defined at level 1 in method test
3535
|
3636
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/captures/refs.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class MonoRef(init: Proc):
1111
var x: MonoProc = init
1212
def setX(x: MonoProc): Unit = this.x = x
1313

14-
def usingLogFile[T](op: (local: caps.Root) ?-> FileOutputStream^{local} => T): T =
14+
def usingLogFile[T](op: (local: caps.Cap) ?-> FileOutputStream^{local} => T): T =
1515
val logFile = FileOutputStream("log")
1616
val result = op(logFile)
1717
logFile.close()
1818
result
1919

2020
def test1 =
21-
usingLogFile[Proc]: (local: caps.Root) ?=> // error (but with a hard to parse error message)
21+
usingLogFile[Proc]: (local: caps.Cap) ?=> // error (but with a hard to parse error message)
2222
(f: FileOutputStream^{local}) =>
2323
() => f.write(1) // this line has type () ->{local} Unit, but usingLogFile
2424
// requires Proc, which expands to () -> 'cap[..test1](from instantiating usingLogFile)

tests/neg-custom-args/captures/sealed-leaks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import java.io.*
33
def Test2 =
44

5-
def usingLogFile[T](op: (l: caps.Root) ?-> FileOutputStream^{l} => T): T =
5+
def usingLogFile[T](op: (l: caps.Cap) ?-> FileOutputStream^{l} => T): T =
66
val logFile = FileOutputStream("log")
77
val result = op(logFile)
88
logFile.close()

tests/neg-custom-args/captures/simple-escapes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class FileOutputStream(str: String):
44

55
def Test1 =
66

7-
def usingLogFile[T](op: (local: caps.Root) -> FileOutputStream^{local} => T): T =
7+
def usingLogFile[T](op: (local: caps.Cap) -> FileOutputStream^{local} => T): T =
88
val logFile = FileOutputStream("log")
99
val result = op(caps.cap)(logFile)
1010
logFile.close()

tests/neg-custom-args/captures/stack-alloc.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Pooled
55
val stack = mutable.ArrayBuffer[Pooled]()
66
var nextFree = 0
77

8-
def withFreshPooled[T](op: (lcap: caps.Root) ?-> Pooled^{lcap} => T): T =
8+
def withFreshPooled[T](op: (lcap: caps.Cap) ?-> Pooled^{lcap} => T): T =
99
if nextFree >= stack.size then stack.append(new Pooled)
1010
val pooled = stack(nextFree)
1111
nextFree = nextFree + 1

tests/neg-custom-args/captures/try.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:23:49 ------------------------------------------
22
23 | val a = handle[Exception, CanThrow[Exception]] { // error
33
| ^
4-
|Found: (lcap: caps.Root) ?->? (x$0: CT[Exception]^{lcap}) ->? box CT[Exception]^{lcap}
5-
|Required: (lcap: caps.Root) ?-> CT[Exception]^{lcap} ->{'cap[..test](from instantiating handle)} box CT[Exception]^
4+
|Found: (lcap: caps.Cap) ?->? (x$0: CT[Exception]^{lcap}) ->? box CT[Exception]^{lcap}
5+
|Required: (lcap: caps.Cap) ?-> CT[Exception]^{lcap} ->{'cap[..test](from instantiating handle)} box CT[Exception]^
66
24 | (x: CanThrow[Exception]) => x
77
25 | }{
88
|

tests/neg-custom-args/captures/try.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def raise[E <: Exception](e: E): Nothing throws E = throw e
1414
def foo(x: Boolean): Int throws Fail =
1515
if x then 1 else raise(Fail())
1616

17-
def handle[E <: Exception, R <: Top](op: (lcap: caps.Root) ?-> CT[E]^{lcap} => R)(handler: E => R): R =
17+
def handle[E <: Exception, R <: Top](op: (lcap: caps.Cap) ?-> CT[E]^{lcap} => R)(handler: E => R): R =
1818
val x: CT[E] = ???
1919
try op(x)
2020
catch case ex: E => handler(ex)

tests/neg-custom-args/captures/try3.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class CT[E]
44
type CanThrow[E] = CT[E]^
55
type Top = Any^
66

7-
def handle[E <: Exception, T <: Top](op: (lcap: caps.Root) ?-> CT[E]^{lcap} ?=> T)(handler: E => T): T =
7+
def handle[E <: Exception, T <: Top](op: (lcap: caps.Cap) ?-> CT[E]^{lcap} ?=> T)(handler: E => T): T =
88
val x: CT[E] = ???
99
try op(using caps.cap)(using x)
1010
catch case ex: E => handler(ex)

tests/neg-custom-args/captures/usingLogFile-alt.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object Test:
77
class Logger(f: OutputStream^):
88
def log(msg: String): Unit = ???
99

10-
def usingFile[T](name: String, op: (lcap: caps.Root) ?-> OutputStream^{lcap} => T): T =
10+
def usingFile[T](name: String, op: (lcap: caps.Cap) ?-> OutputStream^{lcap} => T): T =
1111
val f = new FileOutputStream(name)
1212
val result = op(f)
1313
f.close()

tests/neg-custom-args/captures/usingLogFile.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import annotation.capability
33

44
object Test1:
55

6-
def usingLogFile[T](op: (local: caps.Root) ?-> FileOutputStream => T): T =
6+
def usingLogFile[T](op: (local: caps.Cap) ?-> FileOutputStream => T): T =
77
val logFile = FileOutputStream("log")
88
val result = op(logFile)
99
logFile.close()
@@ -14,7 +14,7 @@ object Test1:
1414

1515
object Test2:
1616

17-
def usingLogFile[T](op: (local: caps.Root) ?-> FileOutputStream^{local} => T): T =
17+
def usingLogFile[T](op: (local: caps.Cap) ?-> FileOutputStream^{local} => T): T =
1818
val logFile = FileOutputStream("log")
1919
val result = op(logFile)
2020
logFile.close()
@@ -38,7 +38,7 @@ object Test2:
3838

3939
object Test3:
4040

41-
def usingLogFile[T](op: (local: caps.Root) ?-> FileOutputStream^{local} => T) =
41+
def usingLogFile[T](op: (local: caps.Cap) ?-> FileOutputStream^{local} => T) =
4242
val logFile = FileOutputStream("log")
4343
val result = op(logFile)
4444
logFile.close()
@@ -50,7 +50,7 @@ object Test4:
5050
class Logger(f: OutputStream^):
5151
def log(msg: String): Unit = ???
5252

53-
def usingFile[T](name: String, op: (local: caps.Root) ?-> OutputStream^{local} => T): T =
53+
def usingFile[T](name: String, op: (local: caps.Cap) ?-> OutputStream^{local} => T): T =
5454
val f = new FileOutputStream(name)
5555
val result = op(f)
5656
f.close()
@@ -62,7 +62,7 @@ object Test4:
6262
val later = usingFile("out", f => (y: Int) => xs.foreach(x => f.write(x + y))) // error
6363
later(1)
6464

65-
def usingLogger[T](f: OutputStream^, op: (local: caps.Root) ?-> Logger^{f} => T): T =
65+
def usingLogger[T](f: OutputStream^, op: (local: caps.Cap) ?-> Logger^{f} => T): T =
6666
val logger = Logger(f)
6767
op(logger)
6868

tests/neg-custom-args/captures/vars.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
| Found: (x$0: String) ->{cap[scope]} String
3131
| Required: (x$0: String) ->? String
3232
|
33-
| Note that reference (cap[scope] : caps.Root), defined at level 2
33+
| Note that reference (cap[scope] : caps.Cap), defined at level 2
3434
| cannot be included in outer capture set ?, defined at level 1 in method test
3535
|
3636
| longer explanation available when compiling with `-explain`
@@ -40,7 +40,7 @@
4040
| Found: (x$0: String) ->{cap[scope]} String
4141
| Required: String => String
4242
|
43-
| Note that reference (cap[scope] : caps.Root), defined at level 2
43+
| Note that reference (cap[scope] : caps.Cap), defined at level 2
4444
| cannot be included in outer capture set ?, defined at level 1 in method test
4545
|
4646
| longer explanation available when compiling with `-explain`

tests/neg-custom-args/captures/vars.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test(cap1: Cap, cap2: Cap) =
3030
val s = scope // error (but should be OK, we need to allow poly-captures)
3131
val sc: String => String = scope // error (but should also be OK)
3232

33-
def local[T](op: (local: caps.Root) -> CC^{local} -> T): T = op(caps.cap)(CC())
33+
def local[T](op: (local: caps.Cap) -> CC^{local} -> T): T = op(caps.cap)(CC())
3434

3535
local { root => cap3 => // error
3636
def g(x: String): String = if cap3 == cap3 then "" else "a"

0 commit comments

Comments
 (0)