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