|
19 | 19 | | Required: LazyRef[Int]^{ref1}
|
20 | 20 | |
|
21 | 21 | | longer explanation available when compiling with `-explain`
|
22 |
| --- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:26:35 -------------------------------------- |
23 |
| -26 | val ref4c: LazyRef[Int]^{cap1} = ref4 // error |
| 22 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/lazyref.scala:30:35 -------------------------------------- |
| 23 | +30 | val ref4c: LazyRef[Int]^{cap1} = ref4 // error |
24 | 24 | | ^^^^
|
25 | 25 | | Found: LazyRef[Int]{val elem: () ->{ref4*} Int}^{ref4}
|
26 | 26 | | Required: LazyRef[Int]^{cap1}
|
27 | 27 | |
|
28 | 28 | | longer explanation available when compiling with `-explain`
|
29 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:25:55 ----------------------------------------------------------- |
30 |
| -25 | val ref4 = (if cap1 == cap2 then ref1 else ref2).map(g) // error: separation failure |
31 |
| - | ^ |
32 |
| - |Separation failure: argument of type (x: Int) ->{cap2} Int |
33 |
| - |to method map: [U](f: T => U): LazyRef[U]^{f, LazyRef.this} |
34 |
| - |corresponds to capture-polymorphic formal parameter f of type Int => Int |
35 |
| - |and hides capabilities {cap2}. |
36 |
| - |Some of these overlap with the captures of the function prefix with type (LazyRef[Int]{val elem: () ->{ref2*} Int} | (ref1 : LazyRef[Int]{val elem: () ->{cap1} Int}^{cap1}))^{ref2}. |
37 |
| - | |
38 |
| - | Hidden set of current argument : {cap2} |
39 |
| - | Hidden footprint of current argument : {cap2} |
40 |
| - | Capture set of function prefix : {ref1, ref2, ref2*} |
41 |
| - | Footprint set of function prefix : {ref1, ref2, ref2*, cap1, cap2} |
42 |
| - | The two sets overlap at : {cap2} |
| 29 | +-- Error: tests/neg-custom-args/captures/lazyref.scala:26:9 ------------------------------------------------------------ |
| 30 | +26 | if cap1 == cap2 // error: separation failure // error: separation failure |
| 31 | + | ^^^^ |
| 32 | + | Separation failure: Illegal access to {cap1} which is hidden by the previous definition |
| 33 | + | of value ref2 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
| 34 | + | This type hides capabilities {ref2*, cap1, cap2, ref1} |
| 35 | +-- Error: tests/neg-custom-args/captures/lazyref.scala:26:17 ----------------------------------------------------------- |
| 36 | +26 | if cap1 == cap2 // error: separation failure // error: separation failure |
| 37 | + | ^^^^ |
| 38 | + | Separation failure: Illegal access to {cap2} which is hidden by the previous definition |
| 39 | + | of value ref2 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
| 40 | + | This type hides capabilities {ref2*, cap1, cap2, ref1} |
| 41 | +-- Error: tests/neg-custom-args/captures/lazyref.scala:27:11 ----------------------------------------------------------- |
| 42 | +27 | then ref1 // error: separation failure |
| 43 | + | ^^^^ |
| 44 | + | Separation failure: Illegal access to {ref1} which is hidden by the previous definition |
| 45 | + | of value ref2 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
| 46 | + | This type hides capabilities {ref2*, cap1, cap2, ref1} |
| 47 | +-- Error: tests/neg-custom-args/captures/lazyref.scala:29:9 ------------------------------------------------------------ |
| 48 | +29 | .map(g) // error: separation failure |
| 49 | + | ^ |
| 50 | + | Separation failure: Illegal access to {cap2} which is hidden by the previous definition |
| 51 | + | of value ref2 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
| 52 | + | This type hides capabilities {ref2*, cap1, cap2, ref1} |
0 commit comments