|
34 | 34 | | Separation failure: method bar's result type BadBuffer[T]^ hides non-local this of class class BadBuffer. |
35 | 35 | | The access must be in a consume method to allow this. |
36 | 36 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:23:17 ----------------------------------------------------- |
| 37 | +Separation failure: Illegal access to (buf : Buffer[Int]^), which was passed as a consume parameter to method app |
| 38 | +and therefore is no longer available. |
| 39 | + |
| 40 | +where: ^ refers to a fresh root capability in the type of parameter buf |
| 41 | +21 | val buf1: Buffer[Int]^ = app(buf, 1) |
| 42 | + | --- |
| 43 | + | The capability was consumed here. |
| 44 | +22 | val buf2 = app(buf1, 2) // OK |
37 | 45 | 23 | val buf3 = app(buf, 3) // error |
38 | 46 | | ^^^ |
39 | | - |Separation failure: Illegal access to (buf : Buffer[Int]^), which was passed as a consume parameter to method app |
40 | | - |on line 21 and therefore is no longer available. |
41 | | - | |
42 | | - |where: ^ refers to a fresh root capability in the type of parameter buf |
| 47 | + | Then, it was used here |
| 48 | + |
43 | 49 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:30:17 ----------------------------------------------------- |
| 50 | +Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
| 51 | +and therefore is no longer available. |
| 52 | + |
| 53 | +where: ^ refers to a fresh root capability in the type of value buf1 |
| 54 | +28 | if ??? then app(buf1, 2) // OK |
| 55 | + | ---- |
| 56 | + | The capability was consumed here. |
| 57 | +29 | else app(buf1, 3) // OK |
44 | 58 | 30 | val buf3 = app(buf1, 4) // error |
45 | 59 | | ^^^^ |
46 | | - |Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
47 | | - |on line 28 and therefore is no longer available. |
48 | | - | |
49 | | - |where: ^ refers to a fresh root capability in the type of value buf1 |
| 60 | + | Then, it was used here |
| 61 | + |
50 | 62 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:38:17 ----------------------------------------------------- |
| 63 | +Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
| 64 | +and therefore is no longer available. |
| 65 | + |
| 66 | +where: ^ refers to a fresh root capability in the type of value buf1 |
| 67 | +35 | case 1 => app(buf1, 2) // OK |
| 68 | + | ---- |
| 69 | + | The capability was consumed here. |
| 70 | +36 | case 2 => app(buf1, 2) |
| 71 | +37 | case _ => app(buf1, 3) |
51 | 72 | 38 | val buf3 = app(buf1, 4) // error |
52 | 73 | | ^^^^ |
53 | | - |Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
54 | | - |on line 35 and therefore is no longer available. |
55 | | - | |
56 | | - |where: ^ refers to a fresh root capability in the type of value buf1 |
| 74 | + | Then, it was used here |
| 75 | + |
57 | 76 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:48:17 ----------------------------------------------------- |
| 77 | +Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
| 78 | +and therefore is no longer available. |
| 79 | + |
| 80 | +where: ^ refers to a fresh root capability in the type of value buf1 |
| 81 | +43 | case 1 => app(buf1, 2) // OK |
| 82 | + | ---- |
| 83 | + | The capability was consumed here. |
| 84 | +44 | case 2 => app(buf1, 2) |
| 85 | +45 | case 3 => app(buf1, 3) |
| 86 | +46 | case 4 => app(buf1, 4) |
| 87 | +47 | case 5 => app(buf1, 5) |
58 | 88 | 48 | val buf3 = app(buf1, 4) // error |
59 | 89 | | ^^^^ |
60 | | - |Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed as a consume parameter to method app |
61 | | - |on line 43 and therefore is no longer available. |
62 | | - | |
63 | | - |where: ^ refers to a fresh root capability in the type of value buf1 |
| 90 | + | Then, it was used here |
| 91 | + |
64 | 92 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:52:8 ------------------------------------------------------ |
65 | 93 | 52 | app(buf, 1) // error |
66 | 94 | | ^^^ |
|
69 | 97 | | |
70 | 98 | | where: ^ refers to a fresh root capability in the type of parameter buf |
71 | 99 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:62:20 ----------------------------------------------------- |
| 100 | +Separation failure: Illegal access to buf.rd, which was passed as a consume parameter to method app |
| 101 | +and therefore is no longer available. |
| 102 | +59 | val buf1 = app(buf, "hi") // buf unavailable from here |
| 103 | + | --- |
| 104 | + | The capability was consumed here. |
| 105 | +60 | val c1 = contents(buf1) // only buf.rd is consumed |
| 106 | +61 | val c2 = contents(buf1) // buf.rd can be consumed repeatedly |
72 | 107 | 62 | val c3 = contents(buf) // error |
73 | 108 | | ^^^ |
74 | | - | Separation failure: Illegal access to buf.rd, which was passed as a consume parameter to method app |
75 | | - | on line 59 and therefore is no longer available. |
| 109 | + | Then, it was used here |
| 110 | + |
0 commit comments