Skip to content

Commit d27544a

Browse files
committed
Put consume and untrackedCaptures annotations also on parameter accessors
1 parent 7a7a18f commit d27544a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/src/scala/caps/package.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package caps
44
import language.experimental.captureChecking
55

66
import annotation.{experimental, compileTimeOnly, retainsCap}
7+
import annotation.meta.*
78

89
/**
910
* Base trait for classes that represent capabilities in the
@@ -157,6 +158,7 @@ object internal:
157158
/** An annotation to reflect that a parameter or method carries the `consume`
158159
* soft modifier.
159160
*/
161+
@getter @param
160162
final class consume extends annotation.StaticAnnotation
161163

162164
/** An internal annotation placed on a refinement created by capture checking.
@@ -193,6 +195,8 @@ end internal
193195

194196
/** A wrapper that strips all covariant capture sets from Mutable types in the
195197
* result of pure operation `op`, turning them into immutable types.
198+
* Array[?] is also included since it counts as a Mutable type for
199+
* separation checking.
196200
*/
197201
@experimental
198202
def freeze(@internal.consume x: Mutable | Array[?]): x.type = x
@@ -220,6 +224,7 @@ object unsafe:
220224
* @note This should go into annotations. For now it is here, so that we
221225
* can experiment with it quickly between minor releases
222226
*/
227+
@getter @param
223228
final class untrackedCaptures extends annotation.StaticAnnotation
224229

225230
extension [T](x: T)

0 commit comments

Comments
 (0)