Skip to content

Commit 98a41c2

Browse files
committed
Fix test
1 parent 0b08c98 commit 98a41c2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/neg-custom-args/captures/i21401.check

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
| ^^^^^^^^^^^^^^^^^^^
99
| The expression's type Res is not allowed to capture the root capability `cap` in its part box IO^.
1010
| This usually means that a capability persists longer than its allowed lifetime.
11+
-- Error: tests/neg-custom-args/captures/i21401.scala:18:21 ------------------------------------------------------------
12+
18 | val y: IO^{x*} = x.unbox // error
13+
| ^^^^^^^
14+
| Local reach capability x* leaks into capture scope of method test2

tests/neg-custom-args/captures/i21401.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def test2() =
1515
val a = usingIO[IO^](x => x) // error: The expression's type IO^ is not allowed to capture the root capability `cap`
1616
val leaked: [R, X <: Boxed[IO^] -> R] -> (op: X) -> R = usingIO[Res](mkRes) // error: The expression's type Res is not allowed to capture the root capability `cap` in its part box IO^
1717
val x: Boxed[IO^] = leaked[Boxed[IO^], Boxed[IO^] -> Boxed[IO^]](x => x)
18-
val y: IO^{x*} = x.unbox
18+
val y: IO^{x*} = x.unbox // error
1919
y.println("boom")

0 commit comments

Comments
 (0)