Skip to content

Commit a045b8c

Browse files
committed
add test case for #21507
1 parent ea19290 commit a045b8c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import language.experimental.captureChecking
2+
3+
trait Box[Cap^]:
4+
def store(f: (() -> Unit)^{Cap^}): Unit
5+
6+
def run[Cap^](f: Box[Cap]^{Cap^} => Unit): Box[Cap]^{Cap^} =
7+
new Box[Cap]:
8+
private var item: () ->{Cap^} Unit = () => ()
9+
def store(f: () ->{Cap^} Unit): Unit =
10+
item = f // was error, now ok

0 commit comments

Comments
 (0)