Skip to content

Commit 1f3d9f5

Browse files
committed
Update tests for retainsArg
1 parent 38bb5eb commit 1f3d9f5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
import caps.cap
2+
13
class Async
24
class C(val x: Async ?=> Unit)
35
def foo(x: Async ?=> Unit): C^{x} = C(x)
4-
def foo(x: Async ?=> Unit)(using Async): C^{x} = C(x)
6+
def foo(x: Async ?=> Unit)(using Async): C^{x} = C(x)
7+
8+
// should also work for reach and read-only capabilities
9+
class D(val x: Async ?=> Unit) extends caps.Mutable
10+
def bar1(x: Async ?=> Unit): D^{cap, x*} = D(x)
11+
def bar1(x: Async ?=> Unit)(using Async): D^{cap, x*} = D(x)
12+
def bar2(x: Async ?=> Unit): D^{cap.rd, x.rd} = D(x)
13+
def bar2(x: Async ?=> Unit)(using Async): D^{cap.rd, x.rd} = D(x)
14+

0 commit comments

Comments
 (0)