Skip to content

Commit 5a440b4

Browse files
committed
Unrelated test
1 parent 28bb69c commit 5a440b4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/pos/cc-use-alternatives.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
var ys = xs
15+
while ys.nonEmpty do
16+
ys = ys.tail
17+
x = ys.head
18+
19+
def foo3[@use C^](xs: List[() ->{C} Unit]): Unit =
20+
var x: () ->{C} Unit = xs.head
21+
var ys = xs
22+
while ys.nonEmpty do
23+
ys = ys.tail
24+
x = ys.head

0 commit comments

Comments
 (0)