|
1 | | --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:9:44 ---------------------------- |
2 | | -9 |def hh[T <: Ref^](x: Box[T]): (Ref^, Int) = (x.elem, 1) // error (but msg is strange since it does not highlight the underlying box conflict) |
3 | | - | ^^^^^^^^^^^ |
4 | | - | Found: (T^'s1, Int) |
5 | | - | Required: (Ref^, Int) |
6 | | - | |
7 | | - | Note that capability cap is not included in capture set {}. |
8 | | - | |
9 | | - | where: ^ refers to a fresh root capability in the result type of method hh |
10 | | - | cap is a fresh root capability in the type of type T |
11 | | - | |
12 | | - | longer explanation available when compiling with `-explain` |
13 | 1 | -- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:7:29 ------------------------------------------------- |
14 | 2 | 7 |def h[T <: Ref^](x: Box[T]): Ref^ = x.elem // error |
15 | 3 | | ^^^^ |
16 | 4 | | Separation failure: method h's result type Ref^ hides cap, which appears in the bound of type T. |
17 | 5 | | This is not allowed. The type T has to be returned explicitly in the result type. |
18 | 6 | | |
19 | 7 | | where: cap is a fresh root capability in the type of type T |
| 8 | +-- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:9:30 ------------------------------------------------- |
| 9 | +9 |def hh[T <: Ref^](x: Box[T]): (Ref^, Int) = (x.elem, 1) // error (but msg is strange since it does not highlight the underlying box conflict) |
| 10 | + | ^^^^^^^^^^^ |
| 11 | + | Separation failure: method hh's result type (Ref^, Int) hides cap, which appears in the bound of type T. |
| 12 | + | This is not allowed. The type T has to be returned explicitly in the result type. |
| 13 | + | |
| 14 | + | where: cap is a fresh root capability in the type of type T |
20 | 15 | -- Error: tests/neg-custom-args/captures/consume-tvar-bound.scala:11:37 ------------------------------------------------ |
21 | 16 | 11 |def g[T <: Ref^](consume x: Box[T]): Ref^ = x.elem // error |
22 | 17 | | ^^^^ |
|
0 commit comments