|
| 1 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/freeze-boxes.scala:22:4 ---------------------------------- |
| 2 | +21 | val xs: Box[Ref^{}] = freeze: |
| 3 | +22 | Box(a) // error |
| 4 | + | ^ |
| 5 | + | Found: Box[Ref^{a.rd}]^{} |
| 6 | + | Required: Box[Ref^{}]^{cap.rd} |
| 7 | + | |
| 8 | + | Note that capability a.rd is not included in capture set {}. |
| 9 | + | |
| 10 | + | where: cap is a fresh root capability classified as Unscoped in the type of value xs |
| 11 | + | |
| 12 | + | longer explanation available when compiling with `-explain` |
| 13 | +-- Error: tests/neg-custom-args/captures/freeze-boxes.scala:29:7 ------------------------------------------------------- |
| 14 | +29 | Box(a) // error |
| 15 | + | ^^^^^^ |
| 16 | + |Separation failure: Illegal access to {cap of value a} which is hidden by the previous definition |
| 17 | + |of value a with type Ref^. |
| 18 | + |This type hides capabilities {cap} |
| 19 | + | |
| 20 | + |where: ^ refers to a fresh root capability classified as Unscoped in the type of value a |
| 21 | + | cap is a fresh root capability classified as Unscoped created in value a when instantiating method allocRef's type (): Ref^² |
| 22 | +-- Error: tests/neg-custom-args/captures/freeze-boxes.scala:31:6 ------------------------------------------------------- |
| 23 | +31 | par(() => a.set(42), () => println(b.get)) // error |
| 24 | + | ^^^^^^^^^^^^^^^ |
| 25 | + |Separation failure: argument of type () ->{a} Unit |
| 26 | + |to method par: (op1: () => Unit, op2: () => Unit): Unit |
| 27 | + |corresponds to capture-polymorphic formal parameter op1 of type () => Unit |
| 28 | + |and hides capabilities {a}. |
| 29 | + |Some of these overlap with the captures of the second argument with type () ->{b.rd} Unit. |
| 30 | + | |
| 31 | + | Hidden set of current argument : {a} |
| 32 | + | Hidden footprint of current argument : {a} |
| 33 | + | Capture set of second argument : {b.rd} |
| 34 | + | Footprint set of second argument : {b.rd, a.rd} |
| 35 | + | The two sets overlap at : {a} |
| 36 | + | |
| 37 | + |where: => refers to a fresh root capability created in method test2 when checking argument to parameter op1 of method par |
| 38 | +-- Error: tests/neg-custom-args/captures/freeze-boxes.scala:37:12 ------------------------------------------------------ |
| 39 | +37 | par(() => a.set(42), () => println(b.get)) // error |
| 40 | + | ^ |
| 41 | + | Separation failure: Illegal access to (a : Ref^), which was passed as a consume parameter to method freeze |
| 42 | + | on line 36 and therefore is no longer available. |
| 43 | + | |
| 44 | + | where: ^ refers to a fresh root capability classified as Unscoped in the type of value a |
0 commit comments