|
| 1 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:22:11 -------------------------------------- |
| 2 | +22 | cur = (() => f.write()) :: Nil // error since {f*} !<: {xs*} |
| 3 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 4 | + | Found: List[box () ->{f} Unit] |
| 5 | + | Required: List[box () ->{xs*} Unit] |
| 6 | + | |
| 7 | + | longer explanation available when compiling with `-explain` |
| 8 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/reaches.scala:33:7 --------------------------------------- |
| 9 | +33 | (() => f.write()) :: Nil // error since {f*} !<: {xs*} |
| 10 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 11 | + | Found: List[box () ->{f} Unit] |
| 12 | + | Required: box List[box () ->{xs*} Unit]^? |
| 13 | + | |
| 14 | + | Note that reference (f : File^), defined in method $anonfun |
| 15 | + | cannot be included in outer capture set {xs*} of value cur which is associated with method runAll1 |
| 16 | + | |
| 17 | + | longer explanation available when compiling with `-explain` |
| 18 | +-- Error: tests/neg-custom-args/captures/reaches.scala:36:6 ------------------------------------------------------------ |
| 19 | +36 | 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:43:15 ----------------------------------------------------------- |
| 24 | +43 | 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:53:31 ----------------------------------------------------------- |
| 31 | +53 | 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. |
0 commit comments