-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Charge also dcs of local reaches to capture set of enclosing method (#…
- Loading branch information
Showing
9 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Error: tests/neg-custom-args/captures/i21442.scala:9:13 ------------------------------------------------------------- | ||
9 | val io = x.unbox // error: local reach capability {x*} leaks | ||
| ^^^^^^^ | ||
| Local reach capability x* leaks into capture scope of method foo | ||
-- Error: tests/neg-custom-args/captures/i21442.scala:17:14 ------------------------------------------------------------ | ||
17 | val io = x1.unbox // error | ||
| ^^^^^^^^ | ||
| Local reach capability x1* leaks into capture scope of method bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import language.experimental.captureChecking | ||
trait IO: | ||
def use(): Unit | ||
case class Boxed[+T](unbox: T) | ||
|
||
// `foo` is a function that unboxes its parameter | ||
// and uses the capability boxed inside the parameter. | ||
def foo(x: Boxed[IO^]): Unit = | ||
val io = x.unbox // error: local reach capability {x*} leaks | ||
io.use() | ||
|
||
// `bar` is a function that does the same thing in a | ||
// slightly different way. | ||
// But, no type error reported. | ||
def bar(x: Boxed[IO^]): Unit = | ||
val x1: Boxed[IO^] = x | ||
val io = x1.unbox // error | ||
io.use() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters