|
34 | 34 | | This type hides capabilities {LazyRef.this.elem}
|
35 | 35 | |
|
36 | 36 | | where: => refers to a fresh root capability in the type of value get
|
37 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:23:13 ----------------------------------------------------------- |
38 |
| -23 | val ref3 = ref1.map(g) // error: separation failure |
39 |
| - | ^^^^ |
40 |
| - | Separation failure: Illegal access to {cap1} which is hidden by the previous definition |
41 |
| - | of value ref2 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
42 |
| - | This type hides capabilities {LazyRef.this.elem, cap1} |
43 |
| - | |
44 |
| - | where: => refers to a fresh root capability in the type of value elem |
45 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:26:9 ------------------------------------------------------------ |
46 |
| -26 | if cap1 == cap2 // error: separation failure // error: separation failure |
47 |
| - | ^^^^ |
48 |
| - | Separation failure: Illegal access to {cap1} which is hidden by the previous definition |
49 |
| - | of value ref3 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
50 |
| - | This type hides capabilities {LazyRef.this.elem, ref2*, cap1} |
51 |
| - | |
52 |
| - | where: => refers to a fresh root capability in the type of value elem |
53 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:26:17 ----------------------------------------------------------- |
54 |
| -26 | if cap1 == cap2 // error: separation failure // error: separation failure |
55 |
| - | ^^^^ |
56 |
| - | Separation failure: Illegal access to {cap2} which is hidden by the previous definition |
57 |
| - | of value ref3 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
58 |
| - | This type hides capabilities {LazyRef.this.elem, ref2*, cap1} |
59 |
| - | |
60 |
| - | where: => refers to a fresh root capability in the type of value elem |
61 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:27:11 ----------------------------------------------------------- |
62 |
| -27 | then ref1 // error: separation failure |
63 |
| - | ^^^^ |
64 |
| - | Separation failure: Illegal access to {cap1, ref1} which is hidden by the previous definition |
65 |
| - | of value ref3 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
66 |
| - | This type hides capabilities {LazyRef.this.elem, ref2*, cap1} |
67 |
| - | |
68 |
| - | where: => refers to a fresh root capability in the type of value elem |
69 |
| --- Error: tests/neg-custom-args/captures/lazyref.scala:28:11 ----------------------------------------------------------- |
70 |
| -28 | else ref2) // error: separation failure |
71 |
| - | ^^^^ |
72 |
| - | Separation failure: Illegal access to {cap1, cap2, ref1} which is hidden by the previous definition |
73 |
| - | of value ref3 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
74 |
| - | This type hides capabilities {LazyRef.this.elem, ref2*, cap1} |
75 |
| - | |
76 |
| - | where: => refers to a fresh root capability in the type of value elem |
77 | 37 | -- Error: tests/neg-custom-args/captures/lazyref.scala:29:9 ------------------------------------------------------------
|
78 | 38 | 29 | .map(g) // error: separation failure
|
79 | 39 | | ^
|
80 |
| - | Separation failure: Illegal access to {cap2} which is hidden by the previous definition |
81 |
| - | of value ref3 with type LazyRef[Int]{val elem: () => Int}^{cap2, ref1}. |
82 |
| - | This type hides capabilities {LazyRef.this.elem, ref2*, cap1} |
83 |
| - | |
84 |
| - | where: => refers to a fresh root capability in the type of value elem |
| 40 | + |Separation failure: argument of type (x: Int) ->{cap2} Int |
| 41 | + |to method map: [U](f: T => U): LazyRef[U]^{f, LazyRef.this} |
| 42 | + |corresponds to capture-polymorphic formal parameter f of type Int => Int |
| 43 | + |and hides capabilities {cap2}. |
| 44 | + |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}. |
| 45 | + | |
| 46 | + | Hidden set of current argument : {cap2} |
| 47 | + | Hidden footprint of current argument : {cap2} |
| 48 | + | Capture set of function prefix : {ref1, ref2, ref2*} |
| 49 | + | Footprint set of function prefix : {ref1, ref2, ref2*, cap1, cap2} |
| 50 | + | The two sets overlap at : {cap2} |
| 51 | + | |
| 52 | + |where: => refers to a fresh root capability created in value ref4 when checking argument to parameter f of method map |
0 commit comments