|
3 | 3 | | ^ |
4 | 4 | | reference (x : C^) is not included in the allowed capture set {} |
5 | 5 | | of an enclosing function literal with expected type () -> Int |
6 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:22:46 --------------------------------------- |
| 6 | +-- Error: tests/neg-custom-args/captures/i15772.scala:22:46 ------------------------------------------------------------ |
7 | 7 | 22 | val boxed1 : ((C^) => Unit) -> Unit = box1(c) // error |
8 | 8 | | ^^^^^^^ |
9 | | - | Found: (C{val arg: C^}^{c} => Unit) ->{c} Unit |
10 | | - | Required: (C^ => Unit) -> Unit |
11 | | - | |
12 | | - | longer explanation available when compiling with `-explain` |
| 9 | + |C^ => Unit cannot be box-converted to box C{val arg: C^}^{c} ->{cap, c} Unit |
| 10 | + |since the additional capture set {c} resulted from box conversion is not allowed in box C{val arg: C^}^{c} => Unit |
13 | 11 | -- Error: tests/neg-custom-args/captures/i15772.scala:28:26 ------------------------------------------------------------ |
14 | 12 | 28 | val c : C^{x} = new C(x) // error |
15 | 13 | | ^ |
16 | 14 | | reference (x : C^) is not included in the allowed capture set {} |
17 | 15 | | of an enclosing function literal with expected type () -> Int |
18 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:29:35 --------------------------------------- |
| 16 | +-- Error: tests/neg-custom-args/captures/i15772.scala:29:35 ------------------------------------------------------------ |
19 | 17 | 29 | val boxed2 : Observe[C^] = box2(c) // error |
20 | 18 | | ^^^^^^^ |
21 | | - | Found: (C{val arg: C^}^{c} => Unit) ->{c} Unit |
22 | | - | Required: (C^ => Unit) -> Unit |
23 | | - | |
24 | | - | longer explanation available when compiling with `-explain` |
| 19 | + |C^ => Unit cannot be box-converted to box C{val arg: C^}^{c} ->{cap, c} Unit |
| 20 | + |since the additional capture set {c} resulted from box conversion is not allowed in box C{val arg: C^}^{c} => Unit |
25 | 21 | -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:35:34 --------------------------------------- |
26 | 22 | 35 | val boxed2 : Observe[C]^ = box2(c) // error |
27 | 23 | | ^ |
|
0 commit comments