File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
tests/neg-custom-args/captures Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ -- Type Error: tests/neg-custom-args/captures/consume-twice.scala:6:7 --------------------------------------------------
2+ Separation failure: Illegal access to (x : Object^), which was passed to a
3+ consume parameter or was used as a prefix to a consume method
4+ and therefore is no longer available.
5+
6+ where: ^ refers to a fresh root capability in the type of parameter x
7+ 5 | send(x)
8+ | -
9+ | The capability was consumed here.
10+ 6 | send(x) // error
11+ | ^
12+ | Then, it was used here
13+
Original file line number Diff line number Diff line change 1+ import language .experimental .captureChecking
2+ import language .experimental .separationChecking
3+ def send (consume x : Object ^ ): Unit = ()
4+ def consumeTwice (consume x : Object ^ ): Unit =
5+ send(x)
6+ send(x) // error
You can’t perform that action at this time.
0 commit comments