|
25 | 25 | | ^^^^^^^^^^^^ |
26 | 26 | | The expression's type box () => Unit is not allowed to capture the root capability `cap`. |
27 | 27 | | This usually means that a capability persists longer than its allowed lifetime. |
28 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:53:2 --------------------------------------- |
29 | | -53 | val id: Id[Proc, Proc] = new Id[Proc, () -> Unit] // error |
30 | | - | ^ |
31 | | - | Found: box () => Unit |
32 | | - | Required: () => Unit |
33 | | - | |
34 | | - | Note that box () => Unit cannot be box-converted to () => Unit |
35 | | - | since at least one of their capture sets contains the root capability `cap` |
36 | | -54 | usingFile: f => |
37 | | -55 | id(() => f.write()) |
38 | | - | |
39 | | - | longer explanation available when compiling with `-explain` |
| 28 | +-- Error: tests/neg-custom-args/captures/reaches.scala:55:6 ------------------------------------------------------------ |
| 29 | +55 | id(() => f.write()) // error |
| 30 | + | ^^^^^^^^^^^^^^^^^^^ |
| 31 | + | Local reach capability id* leaks into capture scope of method test |
40 | 32 | -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:62:27 -------------------------------------- |
41 | 33 | 62 | val f1: File^{id*} = id(f) // error, since now id(f): File^ |
42 | 34 | | ^^^^^ |
|
52 | 44 | 79 | ps.map((x, y) => compose1(x, y)) // error // error |
53 | 45 | | ^ |
54 | 46 | | Local reach capability ps* leaks into capture scope of method mapCompose |
| 47 | +-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:53:51 -------------------------------------- |
| 48 | +53 | val id: Id[Proc, Proc] = new Id[Proc, () -> Unit] // error |
| 49 | + | ^ |
| 50 | + | Type argument () -> Unit does not conform to lower bound () => Unit |
| 51 | + | |
| 52 | + | longer explanation available when compiling with `-explain` |
0 commit comments