We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28bb69c commit 5a440b4Copy full SHA for 5a440b4
tests/pos/cc-use-alternatives.scala
@@ -0,0 +1,24 @@
1
+import language.experimental.captureChecking
2
+// no separation checking
3
+import caps.{cap, use}
4
+
5
+def foo1(@use xs: List[() => Unit]): Unit =
6
+ var x: () ->{xs*} Unit = xs.head
7
+ var ys = xs
8
+ while ys.nonEmpty do
9
+ ys = ys.tail
10
+ x = ys.head
11
12
+def foo2(@use xs: List[() => Unit]): Unit =
13
+ var x: () => Unit = xs.head // note: this would fail separation checking
14
15
16
17
18
19
+def foo3[@use C^](xs: List[() ->{C} Unit]): Unit =
20
+ var x: () ->{C} Unit = xs.head
21
22
23
24
0 commit comments