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 ea19290 commit a045b8cCopy full SHA for a045b8c
tests/pos-custom-args/captures/i21507.scala
@@ -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