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