|
1 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:24:11 -------------------------------------- |
2 | | -24 | cur = (() => f.write()) :: Nil // error since {f*} !<: {xs*} |
| 1 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:22:11 -------------------------------------- |
| 2 | +22 | cur = (() => f.write()) :: Nil // error |
3 | 3 | | ^^^^^^^^^^^^^^^^^^^^^^^ |
4 | 4 | | Found: List[box () ->{f} Unit] |
5 | 5 | | Required: List[box () ->{xs*} Unit] |
6 | 6 | | |
7 | 7 | | longer explanation available when compiling with `-explain` |
8 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:35:7 --------------------------------------- |
9 | | -35 | (() => f.write()) :: Nil // error since {f*} !<: {xs*} |
| 8 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:33:7 --------------------------------------- |
| 9 | +33 | (() => f.write()) :: Nil // error |
10 | 10 | | ^^^^^^^^^^^^^^^^^^^^^^^ |
11 | 11 | | Found: List[box () ->{f} Unit] |
12 | 12 | | Required: box List[box () ->{xs*} Unit]^? |
|
15 | 15 | | cannot be included in outer capture set {xs*} of value cur |
16 | 16 | | |
17 | 17 | | longer explanation available when compiling with `-explain` |
18 | | --- Error: tests/neg-custom-args/captures/reaches.scala:38:6 ------------------------------------------------------------ |
19 | | -38 | var cur: List[Proc] = xs // error: Illegal type for var |
20 | | - | ^ |
21 | | - | Mutable variable cur cannot have type List[box () => Unit] since |
22 | | - | the part box () => Unit of that type captures the root capability `cap`. |
23 | | --- Error: tests/neg-custom-args/captures/reaches.scala:45:15 ----------------------------------------------------------- |
24 | | -45 | val cur = Ref[List[Proc]](xs) // error: illegal type for type argument to Ref |
25 | | - | ^^^^^^^^^^^^^^^ |
26 | | - | Sealed type variable T cannot be instantiated to List[box () => Unit] since |
27 | | - | the part box () => Unit of that type captures the root capability `cap`. |
28 | | - | This is often caused by a local capability in an argument of constructor Ref |
29 | | - | leaking as part of its result. |
30 | | --- Error: tests/neg-custom-args/captures/reaches.scala:55:31 ----------------------------------------------------------- |
31 | | -55 | val id: Id[Proc, Proc] = new Id[Proc, () -> Unit] // error |
32 | | - | ^^^^^^^^^^^^^^^^^^^^ |
33 | | - | Sealed type variable A cannot be instantiated to box () => Unit since |
34 | | - | that type captures the root capability `cap`. |
35 | | - | This is often caused by a local capability in an argument of constructor Id |
36 | | - | leaking as part of its result. |
37 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:57:6 --------------------------------------- |
38 | | -57 | id(() => f.write()) // error |
39 | | - | ^^^^^^^^^^^^^^^^^^^ |
40 | | - | Found: () => Unit |
41 | | - | Required: () ->? Unit |
42 | | - | |
43 | | - | Note that the universal capability `cap` |
44 | | - | cannot be included in capture set ? |
45 | | - | |
46 | | - | longer explanation available when compiling with `-explain` |
47 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:64:27 -------------------------------------- |
48 | | -64 | val f1: File^{id*} = id(f) // error, since now id(f): File^ |
| 18 | +-- Error: tests/neg-custom-args/captures/reaches.scala:38:31 ----------------------------------------------------------- |
| 19 | +38 | val next: () => Unit = cur.head // error |
| 20 | + | ^^^^^^^^ |
| 21 | + | The expression's type box () => Unit is not allowed to capture the root capability `cap`. |
| 22 | + | This usually means that a capability persists longer than its allowed lifetime. |
| 23 | +-- Error: tests/neg-custom-args/captures/reaches.scala:45:35 ----------------------------------------------------------- |
| 24 | +45 | val next: () => Unit = cur.get.head // error |
| 25 | + | ^^^^^^^^^^^^ |
| 26 | + | The expression's type box () => Unit is not allowed to capture the root capability `cap`. |
| 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:62:27 -------------------------------------- |
| 29 | +62 | val f1: File^{id*} = id(f) // error, since now id(f): File^ |
49 | 30 | | ^^^^^ |
50 | | - | Found: File^{id, f} |
| 31 | + | Found: File^{f} |
51 | 32 | | Required: File^{id*} |
52 | 33 | | |
53 | 34 | | longer explanation available when compiling with `-explain` |
54 | | --- Error: tests/neg-custom-args/captures/reaches.scala:81:5 ------------------------------------------------------------ |
55 | | -81 | ps.map((x, y) => compose1(x, y)) // error: cannot mix cap and * (should work now) // error // error |
56 | | - | ^^^^^^ |
57 | | - | Reach capability cap and universal capability cap cannot both |
58 | | - | appear in the type [B](f: ((box A ->{ps*} A, box A ->{ps*} A)) => B): List[B] of this expression |
59 | | --- Error: tests/neg-custom-args/captures/reaches.scala:81:10 ----------------------------------------------------------- |
60 | | -81 | ps.map((x, y) => compose1(x, y)) // error: cannot mix cap and * (should work now) // error // error |
| 35 | +-- Error: tests/neg-custom-args/captures/reaches.scala:79:10 ----------------------------------------------------------- |
| 36 | +79 | ps.map((x, y) => compose1(x, y)) // error // error |
61 | 37 | | ^ |
62 | 38 | | Local reach capability ps* leaks into capture scope of method mapCompose |
63 | | --- Error: tests/neg-custom-args/captures/reaches.scala:81:13 ----------------------------------------------------------- |
64 | | -81 | ps.map((x, y) => compose1(x, y)) // error: cannot mix cap and * (should work now) // error // error |
| 39 | +-- Error: tests/neg-custom-args/captures/reaches.scala:79:13 ----------------------------------------------------------- |
| 40 | +79 | ps.map((x, y) => compose1(x, y)) // error // error |
65 | 41 | | ^ |
66 | 42 | | Local reach capability ps* leaks into capture scope of method mapCompose |
| 43 | +-- [E057] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:53:51 -------------------------------------- |
| 44 | +53 | val id: Id[Proc, Proc] = new Id[Proc, () -> Unit] // error |
| 45 | + | ^ |
| 46 | + | Type argument () -> Unit does not conform to lower bound () => Unit |
| 47 | + | |
| 48 | + | longer explanation available when compiling with `-explain` |
0 commit comments