We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41740f4 commit 72ae1c1Copy full SHA for 72ae1c1
tests/neg-custom-args/captures/escaping-local-roots.scala
@@ -0,0 +1,19 @@
1
+import language.experimental.captureChecking
2
+
3
+trait IO:
4
+ def use: Unit
5
6
+object test1 {
7
+ def foo(c: IO^): IO^{cap[foo]} = c // error
8
+}
9
10
+def test2 = {
11
+ def foo(c: IO^) = // error
12
+ def bar: IO^{cap[foo]} = c
13
+ bar
14
15
16
+object test3 {
17
+ def foo(c: IO^): IO^{cap[bar]} = ??? // error
18
+ def bar(c: IO^): IO^{cap[foo]} = ??? // error
19
tests/neg-custom-args/captures/local-roots-inner-classes.scala
@@ -0,0 +1,9 @@
+class C[T]:
+ object inner:
+ val x: T^{cap[C]} = ??? // error
+class C1[T]:
+ private object inner:
+ val x: T^{cap[C1]} = ??? // ok
0 commit comments