Skip to content

Commit cdc9cf4

Browse files
committed
Adapt to mut->update renames
1 parent 489f785 commit cdc9cf4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

tests/neg-custom-args/captures/matrix.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ trait Rdr[T]:
77
class Ref[T](init: T) extends Rdr[T], Mutable:
88
private var current = init
99
def get: T = current
10-
mut def put(x: T): Unit = current = x
10+
update def put(x: T): Unit = current = x
1111

1212
abstract class IMatrix:
1313
def apply(i: Int, j: Int): Double
1414

1515
class Matrix(nrows: Int, ncols: Int) extends IMatrix, Mutable:
1616
val arr = Array.fill(nrows, ncols)(0.0)
1717
def apply(i: Int, j: Int): Double = arr(i)(j)
18-
mut def update(i: Int, j: Int, x: Double): Unit = arr(i)(j) = x
18+
update def update(i: Int, j: Int, x: Double): Unit = arr(i)(j) = x
1919

2020

2121
def mul(x: Matrix, y: Matrix, z: Matrix^): Unit = ???

tests/neg-custom-args/captures/ro-mut-conformance.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import caps.*
33
class Ref extends Mutable:
44
private var _data: Int = 0
55
def get: Int = _data
6-
mut def set(x: Int): Unit = _data = x
6+
update def set(x: Int): Unit = _data = x
77
def test1(a: Ref^{cap.rd}): Unit =
88
a.set(42) // error
99
def test2(a: Ref^{cap.rd}): Unit =

tests/neg-custom-args/captures/sep-curried-redux.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import caps.*
44
class Ref[T](init: T) extends Mutable:
55
private var value: T = init
66
def get: T = value
7-
mut def set(newValue: T): Unit = value = newValue
7+
update def set(newValue: T): Unit = value = newValue
88

99
// a library function that assumes that a and b MUST BE separate
1010
def swap[T](a: Ref[Int]^, b: Ref[Int]^): Unit = ???

tests/pos-custom-args/captures/deep-adapt.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait Rdr[T]:
77
class Ref[T](init: T) extends Rdr[T], Mutable:
88
private var current = init
99
def get: T = current
10-
mut def put(x: T): Unit = current = x
10+
update def put(x: T): Unit = current = x
1111

1212
case class Pair[+A, +B](x: A, y: B)
1313
class Swap[+A, +B](x: A, y: B) extends Pair[B, A](y, x)

tests/pos-custom-args/captures/matrix.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ trait Rdr[T]:
77
class Ref[T](init: T) extends Rdr[T], Mutable:
88
private var current = init
99
def get: T = current
10-
mut def put(x: T): Unit = current = x
10+
update def put(x: T): Unit = current = x
1111

1212
abstract class IMatrix:
1313
def apply(i: Int, j: Int): Double
1414

1515
class Matrix(nrows: Int, ncols: Int) extends IMatrix, Mutable:
1616
val arr = Array.fill(nrows, ncols)(0.0)
1717
def apply(i: Int, j: Int): Double = arr(i)(j)
18-
mut def update(i: Int, j: Int, x: Double): Unit = arr(i)(j) = x
18+
update def update(i: Int, j: Int, x: Double): Unit = arr(i)(j) = x
1919

2020

2121
def mul(x: Matrix, y: Matrix, z: Matrix^): Unit = ???

0 commit comments

Comments
 (0)