|
| 1 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:11:27 ------------------------------------------------- |
| 2 | +11 |def mkPair(x: Ref^) = Pair(x, x) // error: separation failure |
| 3 | + | ^ |
| 4 | + |Separation failure: argument of type (x : Ref^) |
| 5 | + |to constructor Pair: (fst: Ref^, snd: Ref^): Pair |
| 6 | + |corresponds to capture-polymorphic formal parameter fst of type Ref^² |
| 7 | + |and hides capabilities {x}. |
| 8 | + |Some of these overlap with the captures of the second argument with type (x : Ref^). |
| 9 | + | |
| 10 | + | Hidden set of current argument : {x} |
| 11 | + | Hidden footprint of current argument : {x} |
| 12 | + | Capture set of second argument : {x} |
| 13 | + | Footprint set of second argument : {x} |
| 14 | + | The two sets overlap at : {x} |
| 15 | + | |
| 16 | + |where: ^ refers to a fresh root capability classified as Mutable in the type of parameter x |
| 17 | + | ^² refers to a fresh root capability classified as Mutable created in method mkPair when checking argument to parameter fst of constructor Pair |
| 18 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:35:25 ------------------------------------------------- |
| 19 | +35 | val twoCopy = Pair(two.fst, two.fst) // error |
| 20 | + | ^^^^^^^ |
| 21 | + |Separation failure: argument of type (two.fst : Ref^) |
| 22 | + |to constructor Pair: (fst: Ref^, snd: Ref^): Pair |
| 23 | + |corresponds to capture-polymorphic formal parameter fst of type Ref^² |
| 24 | + |and hides capabilities {two.fst}. |
| 25 | + |Some of these overlap with the captures of the second argument with type (two.fst : Ref^). |
| 26 | + | |
| 27 | + | Hidden set of current argument : {two.fst} |
| 28 | + | Hidden footprint of current argument : {two.fst} |
| 29 | + | Capture set of second argument : {two.fst} |
| 30 | + | Footprint set of second argument : {two.fst} |
| 31 | + | The two sets overlap at : {two.fst} |
| 32 | + | |
| 33 | + |where: ^ refers to a fresh root capability classified as Mutable in the type of value fst |
| 34 | + | ^² refers to a fresh root capability classified as Mutable created in value twoCopy when checking argument to parameter fst of constructor Pair |
| 35 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:41:29 ------------------------------------------------- |
| 36 | +41 | val twisted = PairPair(two.fst, two) // error |
| 37 | + | ^^^^^^^ |
| 38 | + |Separation failure: argument of type (two.fst : Ref^) |
| 39 | + |to constructor PairPair: (fst: Ref^, snd: Pair^): PairPair |
| 40 | + |corresponds to capture-polymorphic formal parameter fst of type Ref^² |
| 41 | + |and hides capabilities {two.fst}. |
| 42 | + |Some of these overlap with the captures of the second argument with type (two : Pair{val fst: Ref^; val snd: Ref^}^). |
| 43 | + | |
| 44 | + | Hidden set of current argument : {two.fst} |
| 45 | + | Hidden footprint of current argument : {two.fst} |
| 46 | + | Capture set of second argument : {two*} |
| 47 | + | Footprint set of second argument : {two*} |
| 48 | + | The two sets overlap at : {two.cap of class Pair} |
| 49 | + | |
| 50 | + |where: ^ refers to a fresh root capability classified as Mutable in the type of value fst |
| 51 | + | ^² refers to a fresh root capability classified as Mutable created in value twisted when checking argument to parameter fst of constructor PairPair |
| 52 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:47:24 ------------------------------------------------- |
| 53 | +47 | val twisted = swapped(two, two.snd) // error |
| 54 | + | ^^^ |
| 55 | + |Separation failure: argument of type (two : Pair{val fst: Ref^; val snd: Ref^²}^³) |
| 56 | + |to method swapped: (@consume x: Pair^, @consume y: Ref^): PairPair^ |
| 57 | + |corresponds to capture-polymorphic formal parameter x of type Pair^⁴ |
| 58 | + |and hides capabilities {two}. |
| 59 | + |Some of these overlap with the captures of the second argument with type (two.snd : Ref^). |
| 60 | + | |
| 61 | + | Hidden set of current argument : {two} |
| 62 | + | Hidden footprint of current argument : {two} |
| 63 | + | Capture set of second argument : {two.snd} |
| 64 | + | Footprint set of second argument : {two.snd} |
| 65 | + | The two sets overlap at : {two.snd} |
| 66 | + | |
| 67 | + |where: ^ refers to a fresh root capability classified as Mutable in the type of value fst |
| 68 | + | ^² refers to a fresh root capability classified as Mutable in the type of value snd |
| 69 | + | ^³ refers to a fresh root capability in the type of value two |
| 70 | + | ^⁴ refers to a fresh root capability created in value twisted when checking argument to parameter x of method swapped |
| 71 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:58:22 ------------------------------------------------- |
| 72 | +58 | val twoOther = Pair(two.fst, two.snd) // error // error |
| 73 | + | ^^^ |
| 74 | + | Separation failure: Illegal access to {two.fst} which is hidden by the previous definition |
| 75 | + | of value twoCopy with type Pair^. |
| 76 | + | This type hides capabilities {two.fst, two.snd} |
| 77 | + | |
| 78 | + | where: ^ refers to a fresh root capability in the type of value twoCopy |
| 79 | +-- Error: tests/neg-custom-args/captures/sep-pairs-unboxed.scala:58:31 ------------------------------------------------- |
| 80 | +58 | val twoOther = Pair(two.fst, two.snd) // error // error |
| 81 | + | ^^^ |
| 82 | + | Separation failure: Illegal access to {two.snd} which is hidden by the previous definition |
| 83 | + | of value twoCopy with type Pair^. |
| 84 | + | This type hides capabilities {two.fst, two.snd} |
| 85 | + | |
| 86 | + | where: ^ refers to a fresh root capability in the type of value twoCopy |
0 commit comments