Skip to content

Commit f0f61ed

Browse files
committed
Drop Read as a classifier
1 parent 48f8c0f commit f0f61ed

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

library/src/scala/caps/package.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ trait Mutable extends ExclusiveCapability
8484

8585
/** Marker trait for classes with reader methods, typically extended by Mutable classes */
8686
@experimental
87-
trait Read extends Mutable, Classifier
87+
@deprecated
88+
trait Read extends Mutable
8889

8990
/** Marker trait for classes that are not subject to scoping restrictions
9091
* of captured capabilities.

tests/neg-custom-args/captures/check-inferred.check

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
|
4444
| where: ^ refers to a fresh root capability in the type of value y
4545
-- Error: tests/neg-custom-args/captures/check-inferred.scala:49:15 ----------------------------------------------------
46-
49 | private val y = ??? : (() => A^{cap.only[caps.Read]}) // error
46+
49 | private val y = ??? : (() => A^{cap.only[caps.Unscoped]}) // error
4747
| ^
48-
| value y needs an explicit type because it captures a root capability in its type () => test.A^{cap.only[Read]}.
49-
| Fields capturing a root capability need to be given an explicit type unless the capability is already
50-
| subsumed by the computed capability of the enclosing class.
48+
|value y needs an explicit type because it captures a root capability in its type () => test.A^{cap.only[Unscoped]}.
49+
|Fields capturing a root capability need to be given an explicit type unless the capability is already
50+
|subsumed by the computed capability of the enclosing class.
5151
|
52-
| where: => refers to a fresh root capability in the type of value y
53-
| cap is a fresh root capability created in value y
52+
|where: => refers to a fresh root capability in the type of value y
53+
| cap is a fresh root capability created in value y
5454
-- Error: tests/neg-custom-args/captures/check-inferred.scala:29:21 ----------------------------------------------------
5555
29 | private val count = Ref() // error
5656
| ^

tests/neg-custom-args/captures/check-inferred.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ class C:
4646

4747
class D:
4848
val x: A^{cap.only[caps.Control]} = ???
49-
private val y = ??? : (() => A^{cap.only[caps.Read]}) // error
49+
private val y = ??? : (() => A^{cap.only[caps.Unscoped]}) // error
5050

tests/neg-custom-args/captures/classified-inheritance.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/neg-custom-args/captures/classified-inheritance.scala:5:6 ----------------------------------------------
2-
5 |class C2 extends caps.Control, caps.Read // error
2+
5 |class C2 extends caps.Control, caps.Unscoped // error
33
| ^
4-
| class C2 inherits two unrelated classifier traits: trait Read and trait Control
4+
| class C2 inherits two unrelated classifier traits: trait Unscoped and trait Control
55
-- Error: tests/neg-custom-args/captures/classified-inheritance.scala:10:6 ---------------------------------------------
66
10 |class C3 extends Matrix, Async // error
77
| ^

tests/neg-custom-args/captures/classified-inheritance.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import language.experimental.captureChecking
22

33
class C1 extends caps.Control, caps.SharedCapability // OK
44

5-
class C2 extends caps.Control, caps.Read // error
5+
class C2 extends caps.Control, caps.Unscoped // error
66

77
trait Async extends caps.Control
88
class Matrix extends caps.Unscoped

tests/neg-custom-args/captures/classifiers-1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class M extends caps.Read
1+
class M extends caps.Unscoped
22

33
class M1(x: Int => Int) extends M // error
44

tests/pos-custom-args/captures/restrict-try.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import caps.{SharedCapability, Control, Read}
1+
import caps.{SharedCapability, Control, Unscoped}
22

33
class Try[+T]
44
case class Ok[T](x: T) extends Try[T]
55
case class Fail(ex: Exception) extends Try[Nothing]
66

7-
trait Matrix extends Read:
7+
trait Matrix extends Unscoped:
88
def get(): Unit
99

1010
trait Label extends Control:

0 commit comments

Comments
 (0)