-
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.
Correct rules for CapSet; update definition for Contains; fix tests
- Loading branch information
Showing
9 changed files
with
42 additions
and
27 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 @@ | ||
import caps.* | ||
|
||
class IO | ||
class File(io: IO^) | ||
|
||
class Handler[C^]: | ||
def f(file: File^): File^{C^} = file // error | ||
def g(file: File^{C^}): File^ = file // ok |
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
-- Error: tests/neg-custom-args/captures/use-capset.scala:7:50 --------------------------------------------------------- | ||
7 |private def g[C^] = (xs: List[Object^{C^}]) => xs.head // error | ||
-- Error: tests/neg-custom-args/captures/use-capset.scala:5:50 --------------------------------------------------------- | ||
5 |private def g[C^] = (xs: List[Object^{C^}]) => xs.head // error | ||
| ^^^^^^^ | ||
| Capture set parameter C leaks into capture scope of method g. | ||
| To allow this, the type C should be declared with a @use annotation | ||
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:13:22 ----------------------------------- | ||
13 | val _: () -> Unit = h // error: should be ->{io} | ||
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:11:22 ----------------------------------- | ||
11 | val _: () -> Unit = h // error: should be ->{io} | ||
| ^ | ||
| Found: (h : () ->{io} Unit) | ||
| Required: () -> Unit | ||
| | ||
| longer explanation available when compiling with `-explain` | ||
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:15:50 ----------------------------------- | ||
15 | val _: () -> List[Object^{io}] -> Object^{io} = h2 // error, should be ->{io} | ||
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/use-capset.scala:13:50 ----------------------------------- | ||
13 | val _: () -> List[Object^{io}] -> Object^{io} = h2 // error, should be ->{io} | ||
| ^^ | ||
| Found: (h2 : () ->? (x$0: List[box Object^]^{}) ->{io} Object^{io}) | ||
| Required: () -> List[box Object^{io}] -> Object^{io} | ||
| Found: (h2 : () ->? (x$0: List[box Object^{io}]^{}) ->{io} Object^{io}) | ||
| Required: () -> List[box Object^{io}] -> Object^{io} | ||
| | ||
| longer explanation available when compiling with `-explain` |
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