|
43 | 43 | | Note that capability x is not included in capture set {}. |
44 | 44 | | |
45 | 45 | | longer explanation available when compiling with `-explain` |
46 | | --- Error: tests/neg-custom-args/captures/capt1.scala:36:16 ------------------------------------------------------------- |
47 | | -36 | val z2 = h[() -> Cap](() => x) // error // error |
48 | | - | ^^^^^^^^^ |
49 | | - | Type variable X of method h cannot be instantiated to () -> C^ since |
50 | | - | the part C^ of that type captures the root capability `cap`. |
51 | | - | |
52 | | - | where: ^ refers to the universal root capability |
53 | 46 | -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:36:24 ---------------------------------------- |
54 | | -36 | val z2 = h[() -> Cap](() => x) // error // error |
| 47 | +36 | val z2 = h[() -> Cap](() => x) // error |
55 | 48 | | ^^^^^^^ |
56 | | - |Found: () ->'s2 C^ |
57 | | - |Required: () -> C^² |
| 49 | + | Found: () ->'s2 C^ |
| 50 | + | Required: () -> C^² |
58 | 51 | | |
59 | | - |Note that capability cap is not included in capture set {cap²} |
60 | | - |because cap is not visible from cap² in value z2. |
| 52 | + | Note that capability cap is not included in capture set {cap²} |
| 53 | + | because cap is not visible from cap² in value z2. |
61 | 54 | | |
62 | | - |where: ^ and cap refer to a root capability associated with the result type of (): C^ |
63 | | - | ^² and cap² refer to a fresh root capability created in value z2 when checking argument to parameter a of method h |
| 55 | + | where: ^ and cap refer to a root capability associated with the result type of (): C^ |
| 56 | + | ^² and cap² refer to a fresh root capability created in value z2 |
64 | 57 | | |
65 | 58 | | longer explanation available when compiling with `-explain` |
66 | 59 | -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:37:5 ----------------------------------------- |
67 | 60 | 37 | (() => C()) // error |
68 | 61 | | ^^^^^^^^^ |
69 | | - |Found: () ->'s3 C^ |
70 | | - |Required: () -> C^² |
| 62 | + | Found: () ->'s3 C^ |
| 63 | + | Required: () -> C^² |
71 | 64 | | |
72 | | - |Note that capability cap is not included in capture set {cap²} |
73 | | - |because cap is not visible from cap² in value z2. |
| 65 | + | Note that capability cap is not included in capture set {cap²} |
| 66 | + | because cap is not visible from cap² in value z2. |
74 | 67 | | |
75 | | - |where: ^ and cap refer to a root capability associated with the result type of (): C^ |
76 | | - | ^² and cap² refer to a fresh root capability created in value z2 when checking argument to parameter b of method h |
| 68 | + | where: ^ and cap refer to a root capability associated with the result type of (): C^ |
| 69 | + | ^² and cap² refer to a fresh root capability created in value z2 |
77 | 70 | | |
78 | 71 | | longer explanation available when compiling with `-explain` |
79 | | --- Error: tests/neg-custom-args/captures/capt1.scala:38:13 ------------------------------------------------------------- |
| 72 | +-- Error: tests/neg-custom-args/captures/capt1.scala:38:51 ------------------------------------------------------------- |
80 | 73 | 38 | val z3 = h[(() -> Cap) @retains[x.type]](() => x)(() => C()) // error |
81 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
82 | | - | Type variable X of method h cannot be instantiated to () ->{x} C^ since |
83 | | - | the part C^ of that type captures the root capability `cap`. |
84 | | - | |
85 | | - | where: ^ refers to the universal root capability |
| 74 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 75 | + | Separation failure: Illegal access to {x} which is hidden by the previous definition |
| 76 | + | of value z2 with type () ->{} C^. |
| 77 | + | This type hides capabilities {cap, x} |
| 78 | + | |
| 79 | + | where: ^ refers to a fresh root capability in the type of value z2 |
| 80 | + | cap is a fresh root capability created in value z2 |
| 81 | +-- Error: tests/neg-custom-args/captures/capt1.scala:40:25 ------------------------------------------------------------- |
| 82 | +40 | val z1: () => Cap = f1(x) // error |
| 83 | + | ^ |
| 84 | + | Separation failure: Illegal access to {x} which is hidden by the previous definition |
| 85 | + | of value z3 with type () ->{x} C^. |
| 86 | + | This type hides capabilities {cap, x} |
| 87 | + | |
| 88 | + | where: ^ refers to a fresh root capability in the type of value z3 |
| 89 | + | cap is a fresh root capability created in value z3 |
86 | 90 | -- Error: tests/neg-custom-args/captures/capt1.scala:43:7 -------------------------------------------------------------- |
87 | 91 | 43 | if x == null then // error: separation |
88 | 92 | | ^ |
|
0 commit comments