Skip to content

Commit e08a59f

Browse files
committed
Make classes added by cc experimental
1 parent 0221744 commit e08a59f

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package scala
2+
import annotation.experimental
23

34
/** An annotation that indicates capture
45
*/
5-
class retains(xs: Any*) extends annotation.StaticAnnotation
6+
@experimental class retains(xs: Any*) extends annotation.StaticAnnotation
67

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package scala.annotation.internal
22

3-
import scala.annotation.StaticAnnotation
3+
import annotation.{StaticAnnotation, experimental}
44

55
/** An annotation to record a required capaility in the type of a throws
66
*/
7-
class requiresCapability(capability: Any) extends StaticAnnotation
7+
@experimental class requiresCapability(capability: Any) extends StaticAnnotation
88

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package scala
2+
import annotation.experimental
23

34
/** An annotation that indicates capture of an enclosing by-name type
45
*/
5-
class retainsByName(xs: Any*) extends annotation.StaticAnnotation
6+
@experimental class retainsByName(xs: Any*) extends annotation.StaticAnnotation
67

library/src/scala/annotation/capability.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package scala.annotation
2+
import annotation.experimental
23

34
/** Marks an annotated class as a capability.
45
* If the annotation is present and -Ycc is set, any (possibly aliased
@@ -10,4 +11,4 @@ package scala.annotation
1011
* THere, the capture set of any instance of `CanThrow` is assumed to be
1112
* `{*}`.
1213
*/
13-
final class capability extends StaticAnnotation
14+
@experimental final class capability extends StaticAnnotation
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package scala.annotation
22
package internal
3+
import annotation.experimental
34

45
/** A marker annotation on a toplevel class that indicates
56
* that the class was checked under -Ycc
67
*/
7-
class CaptureChecked extends StaticAnnotation
8+
@experimental class CaptureChecked extends StaticAnnotation
89

tests/run-custom-args/tasty-inspector/stdlibExperimentalDefinitions.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ val experimentalDefinitionInLibrary = Set(
4646
"scala.annotation.newMain.Help$",
4747
"scala.annotation.newMain.Names",
4848

49+
//// New feature: capture checking
50+
"scala.annotation.capability",
51+
"scala.annotation.internal.CaptureChecked",
52+
"scala.annotation.internal.requiresCapability",
53+
"scala.retains",
54+
"scala.retainsByName",
55+
4956
//// New APIs: Mirror
5057
// Can be stabilized in 3.3.0 or later.
5158
"scala.deriving.Mirror$.fromProductTyped", // This API is a bit convoluted. We may need some more feedback before we can stabilize it.

0 commit comments

Comments
 (0)