|
| 1 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/linear-buffer.scala:7:29 --------------------------------- |
| 2 | +7 | def bar: BadBuffer[T]^ = this // error |
| 3 | + | ^^^^ |
| 4 | + | Found: BadBuffer[T]^{BadBuffer.this.rd} |
| 5 | + | Required: BadBuffer[T]^ |
| 6 | + | |
| 7 | + | Note that capability BadBuffer.this.rd is not included in capture set {}. |
| 8 | + | |
| 9 | + | Note that {cap} is an exclusive capture set of the mutable type BadBuffer[T]^, |
| 10 | + | it cannot subsume a read-only capture set of the mutable type BadBuffer[T]^{BadBuffer.this.rd}. |
| 11 | + | |
| 12 | + | where: ^ and cap refer to a fresh root capability classified as Mutable in the result type of method bar |
| 13 | + | |
| 14 | + | longer explanation available when compiling with `-explain` |
1 | 15 | -- Error: tests/neg-custom-args/captures/linear-buffer.scala:5:27 ------------------------------------------------------ |
2 | 16 | 5 | update def append(x: T): BadBuffer[T]^ = this // error |
3 | 17 | | ^^^^^^^^^^^^^ |
4 | 18 | | Separation failure: method append's result type BadBuffer[T]^ hides non-local this of class class BadBuffer. |
5 | 19 | | The access must be in a consume method to allow this. |
6 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:7:29 ------------------------------------------------------ |
7 | | -7 | def bar: BadBuffer[T]^ = this // error // error |
8 | | - | ^^^^ |
9 | | - | Separation failure: Illegal access to {BadBuffer.this} which is hidden by the previous definition |
10 | | - | of method append with result type BadBuffer[T]^. |
11 | | - | This type hides capabilities {BadBuffer.this} |
12 | | - | |
13 | | - | where: ^ refers to a fresh root capability classified as Mutable in the result type of method append |
14 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:7:13 ------------------------------------------------------ |
15 | | -7 | def bar: BadBuffer[T]^ = this // error // error |
16 | | - | ^^^^^^^^^^^^^ |
17 | | - | Separation failure: method bar's result type BadBuffer[T]^ hides non-local this of class class BadBuffer. |
18 | | - | The access must be in a consume method to allow this. |
19 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:19:17 ----------------------------------------------------- |
20 | | -19 | val buf3 = app(buf, 3) // error |
| 20 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:10:29 ----------------------------------------------------- |
| 21 | +10 | def bar: BadBuffer[T]^ = this // error // error |
| 22 | + | ^^^^ |
| 23 | + | Separation failure: Illegal access to {BadBuffer.this} which is hidden by the previous definition |
| 24 | + | of method append with result type BadBuffer[T]^. |
| 25 | + | This type hides capabilities {BadBuffer.this} |
| 26 | + | |
| 27 | + | where: ^ refers to a fresh root capability classified as Mutable in the result type of method append |
| 28 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:10:13 ----------------------------------------------------- |
| 29 | +10 | def bar: BadBuffer[T]^ = this // error // error |
| 30 | + | ^^^^^^^^^^^^^ |
| 31 | + | Separation failure: method bar's result type BadBuffer[T]^ hides non-local this of class class BadBuffer. |
| 32 | + | The access must be in a consume method to allow this. |
| 33 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:22:17 ----------------------------------------------------- |
| 34 | +22 | val buf3 = app(buf, 3) // error |
21 | 35 | | ^^^ |
22 | 36 | | Separation failure: Illegal access to (buf : Buffer[Int]^), which was passed to a |
23 | | - | consume parameter or was used as a prefix to a consume method on line 17 |
| 37 | + | consume parameter or was used as a prefix to a consume method on line 20 |
24 | 38 | | and therefore is no longer available. |
25 | 39 | | |
26 | 40 | | where: ^ refers to a fresh root capability classified as Mutable in the type of parameter buf |
27 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:26:17 ----------------------------------------------------- |
28 | | -26 | val buf3 = app(buf1, 4) // error |
| 41 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:29:17 ----------------------------------------------------- |
| 42 | +29 | val buf3 = app(buf1, 4) // error |
29 | 43 | | ^^^^ |
30 | 44 | | Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed to a |
31 | | - | consume parameter or was used as a prefix to a consume method on line 24 |
| 45 | + | consume parameter or was used as a prefix to a consume method on line 27 |
32 | 46 | | and therefore is no longer available. |
33 | 47 | | |
34 | 48 | | where: ^ refers to a fresh root capability classified as Mutable in the type of value buf1 |
35 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:34:17 ----------------------------------------------------- |
36 | | -34 | val buf3 = app(buf1, 4) // error |
| 49 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:37:17 ----------------------------------------------------- |
| 50 | +37 | val buf3 = app(buf1, 4) // error |
37 | 51 | | ^^^^ |
38 | 52 | | Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed to a |
39 | | - | consume parameter or was used as a prefix to a consume method on line 31 |
| 53 | + | consume parameter or was used as a prefix to a consume method on line 34 |
40 | 54 | | and therefore is no longer available. |
41 | 55 | | |
42 | 56 | | where: ^ refers to a fresh root capability classified as Mutable in the type of value buf1 |
43 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:44:17 ----------------------------------------------------- |
44 | | -44 | val buf3 = app(buf1, 4) // error |
| 57 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:47:17 ----------------------------------------------------- |
| 58 | +47 | val buf3 = app(buf1, 4) // error |
45 | 59 | | ^^^^ |
46 | 60 | | Separation failure: Illegal access to (buf1 : Buffer[Int]^), which was passed to a |
47 | | - | consume parameter or was used as a prefix to a consume method on line 39 |
| 61 | + | consume parameter or was used as a prefix to a consume method on line 42 |
48 | 62 | | and therefore is no longer available. |
49 | 63 | | |
50 | 64 | | where: ^ refers to a fresh root capability classified as Mutable in the type of value buf1 |
51 | | --- Error: tests/neg-custom-args/captures/linear-buffer.scala:48:8 ------------------------------------------------------ |
52 | | -48 | app(buf, 1) // error |
| 65 | +-- Error: tests/neg-custom-args/captures/linear-buffer.scala:51:8 ------------------------------------------------------ |
| 66 | +51 | app(buf, 1) // error |
53 | 67 | | ^^^ |
54 | 68 | | Separation failure: (buf : Buffer[Int]^) appears in a loop, therefore it cannot |
55 | 69 | | be passed to a consume parameter or be used as a prefix of a consume method call. |
|
0 commit comments