|
24 | 24 | | where: ^ and cap refer to a fresh root capability classified as Mutable in the type of value self2 |
25 | 25 | | |
26 | 26 | | longer explanation available when compiling with `-explain` |
27 | | --- Error: tests/neg-custom-args/captures/mutability.scala:15:25 -------------------------------------------------------- |
28 | | -15 | def set(x: T) = this.x.set(x) // error |
| 27 | +-- Error: tests/neg-custom-args/captures/mutability.scala:14:12 -------------------------------------------------------- |
| 28 | +14 | self3().set(x) // error |
| 29 | + | ^^^^^^^^^^^ |
| 30 | + | cannot call update method set from Ref[T^{}]^{Ref.this.rd}, |
| 31 | + | since its capture set {Ref.this.rd} of value self3 is read-only |
| 32 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/mutability.scala:15:31 ----------------------------------- |
| 33 | +15 | val self4: () => Ref[T]^ = () => this // error |
| 34 | + | ^^^^^^^^^^ |
| 35 | + | Found: () ->{Ref.this} Ref[T^'s1]^{Ref.this.rd} |
| 36 | + | Required: () => Ref[T]^ |
| 37 | + | |
| 38 | + | Note that capability Ref.this.rd is not included in capture set {}. |
| 39 | + | |
| 40 | + | Note that {cap} is an exclusive capture set of the mutable type Ref[T]^, |
| 41 | + | it cannot subsume a read-only capture set of the mutable type Ref[T^'s1]^{Ref.this.rd}. |
| 42 | + | |
| 43 | + | where: => refers to a fresh root capability in the type of value self4 |
| 44 | + | ^ and cap refer to a fresh root capability classified as Mutable in the type of value self4 |
| 45 | + | |
| 46 | + | longer explanation available when compiling with `-explain` |
| 47 | +-- Error: tests/neg-custom-args/captures/mutability.scala:19:12 -------------------------------------------------------- |
| 48 | +19 | self5().set(x) // error |
| 49 | + | ^^^^^^^^^^^ |
| 50 | + | cannot call update method set from Ref[T^{}]^{Ref.this.rd}, |
| 51 | + | since its capture set {Ref.this.rd} of method self5 is read-only |
| 52 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/mutability.scala:20:27 ----------------------------------- |
| 53 | +20 | def self6(): Ref[T]^ = this // error |
| 54 | + | ^^^^ |
| 55 | + | Found: Ref[T]^{Ref.this.rd} |
| 56 | + | Required: Ref[T]^ |
| 57 | + | |
| 58 | + | Note that capability Ref.this.rd is not included in capture set {}. |
| 59 | + | |
| 60 | + | Note that {cap} is an exclusive capture set of the mutable type Ref[T]^, |
| 61 | + | it cannot subsume a read-only capture set of the mutable type Ref[T]^{Ref.this.rd}. |
| 62 | + | |
| 63 | + | where: ^ and cap refer to a fresh root capability classified as Mutable in the result type of method self6 |
| 64 | + | |
| 65 | + | longer explanation available when compiling with `-explain` |
| 66 | +-- Error: tests/neg-custom-args/captures/mutability.scala:25:25 -------------------------------------------------------- |
| 67 | +25 | def set(x: T) = this.x.set(x) // error |
29 | 68 | | ^^^^^^^^^^ |
30 | 69 | | cannot call update method set from (Ref2.this.x : Ref[T^{}]^), |
31 | 70 | | since the access is in method set, which is not an update method |
32 | 71 | | |
33 | 72 | | where: ^ refers to a fresh root capability classified as Mutable in the type of value x |
34 | | --- Error: tests/neg-custom-args/captures/mutability.scala:22:5 --------------------------------------------------------- |
35 | | -22 | r1.set(33) // error |
| 73 | +-- Error: tests/neg-custom-args/captures/mutability.scala:32:5 --------------------------------------------------------- |
| 74 | +32 | r1.set(33) // error |
36 | 75 | | ^^^^^^ |
37 | 76 | | cannot call update method set from (r1 : Ref[Int]), |
38 | 77 | | since its capture set {r1} is read-only |
39 | | --- Error: tests/neg-custom-args/captures/mutability.scala:27:7 --------------------------------------------------------- |
40 | | -27 | r3.x.set(33) // error |
| 78 | +-- Error: tests/neg-custom-args/captures/mutability.scala:37:7 --------------------------------------------------------- |
| 79 | +37 | r3.x.set(33) // error |
41 | 80 | | ^^^^^^^^ |
42 | 81 | | cannot call update method set from (r3.x : Ref[Int]^), |
43 | 82 | | since the capture set {r3} of its prefix (r3 : Ref2[Int]) is read-only |
44 | 83 | | |
45 | 84 | | where: ^ refers to a fresh root capability classified as Mutable in the type of value x |
| 85 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/mutability.scala:42:29 ----------------------------------- |
| 86 | +42 | val r5: () => Ref2[Int]^ = () => ref2 // error |
| 87 | + | ^^^^^^^^^^ |
| 88 | + | Found: () ->{ref2} Ref2[Int]^{ref2} |
| 89 | + | Required: () => Ref2[Int]^ |
| 90 | + | |
| 91 | + | Note that capability ref2 is not included in capture set {}. |
| 92 | + | |
| 93 | + | Note that {cap} is an exclusive capture set of the mutable type Ref2[Int]^, |
| 94 | + | it cannot subsume a read-only capture set of the mutable type Ref2[Int]^{ref2}. |
| 95 | + | |
| 96 | + | where: => refers to a fresh root capability in the type of value r5 |
| 97 | + | ^ and cap refer to a fresh root capability classified as Mutable in the type of value r5 |
| 98 | + | |
| 99 | + | longer explanation available when compiling with `-explain` |
| 100 | +-- Error: tests/neg-custom-args/captures/mutability.scala:45:9 --------------------------------------------------------- |
| 101 | +45 | r6().x.set(33) // error |
| 102 | + | ^^^^^^^^^^ |
| 103 | + | cannot call update method set from Ref[Int]^{cap.rd}, |
| 104 | + | since its capture set {cap.rd} is read-only |
| 105 | + | |
| 106 | + | where: cap is a fresh root capability classified as Mutable in the type of value r6 |
0 commit comments