Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Aug 26, 2024
1 parent 0b08c98 commit 98a41c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/neg-custom-args/captures/i21401.check
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
| ^^^^^^^^^^^^^^^^^^^
| The expression's type Res is not allowed to capture the root capability `cap` in its part box IO^.
| This usually means that a capability persists longer than its allowed lifetime.
-- Error: tests/neg-custom-args/captures/i21401.scala:18:21 ------------------------------------------------------------
18 | val y: IO^{x*} = x.unbox // error
| ^^^^^^^
| Local reach capability x* leaks into capture scope of method test2
2 changes: 1 addition & 1 deletion tests/neg-custom-args/captures/i21401.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def test2() =
val a = usingIO[IO^](x => x) // error: The expression's type IO^ is not allowed to capture the root capability `cap`
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^
val x: Boxed[IO^] = leaked[Boxed[IO^], Boxed[IO^] -> Boxed[IO^]](x => x)
val y: IO^{x*} = x.unbox
val y: IO^{x*} = x.unbox // error
y.println("boom")

0 comments on commit 98a41c2

Please sign in to comment.