Skip to content

Make caps.Capability non-experimental #23507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2109,10 +2109,9 @@ class Definitions {
*/
@tu lazy val ccExperimental: Set[Symbol] = Set(
CapsModule, CapsModule.moduleClass, PureClass,
Caps_Capability, // TODO: Remove when Capability is stabilized
RequiresCapabilityAnnot,
captureRoot, Caps_CapSet, Caps_ContainsTrait, Caps_ContainsModule, Caps_ContainsModule.moduleClass, UseAnnot,
Caps_Mutable, Caps_Sharable, Caps_Control, Caps_Classifier, ConsumeAnnot,
Caps_Mutable/* , Caps_Sharable, Caps_Control, Caps_Classifier -- already stable*/, ConsumeAnnot,
CapsUnsafeModule, CapsUnsafeModule.moduleClass,
CapsInternalModule, CapsInternalModule.moduleClass,
RetainsAnnot, RetainsCapAnnot, RetainsByNameAnnot)
Expand Down
4 changes: 0 additions & 4 deletions library/src/scala/caps/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ import annotation.{experimental, compileTimeOnly, retainsCap}
* But even without capture checking, extending this trait can be useful for documenting the intended purpose
* of a class.
*/
@experimental
trait Capability extends Any

/** A marker trait for classifier capabilities that can appear in `.only`
* qualifiers. Capability classes directly extending `Classifier` are treated
* as classifier capbilities
*/
@experimental
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't we supposed to only make Capability non experimental?

trait Classifier

/** The universal capture reference. */
Expand All @@ -43,13 +41,11 @@ trait Mutable extends Capability, Classifier
/** Marker trait for capabilities that can be safely shared in a concurrent context.
* During separation checking, shared capabilities are not taken into account.
*/
@experimental
trait Sharable extends Capability, Classifier

/** Base trait for capabilities that capture some continuation or return point in
* the stack. Examples are exceptions, labels, Async, CanThrow.
*/
@experimental
trait Control extends Sharable, Classifier

/** Carrier trait for capture set type parameters */
Expand Down
6 changes: 6 additions & 0 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ object MiMaFilters {
ProblemFilters.exclude[MissingClassProblem]("scala.Conversion$"),

ProblemFilters.exclude[MissingClassProblem]("scala.annotation.stableNull"),

// Change `caps.Capability` to non-experimental
ProblemFilters.exclude[MissingClassProblem]("scala.caps.Capability"),
ProblemFilters.exclude[MissingClassProblem]("scala.caps.Classifier"),
ProblemFilters.exclude[MissingClassProblem]("scala.caps.Shared"),
ProblemFilters.exclude[MissingClassProblem]("scala.caps.Control"),
),

// Additions since last LTS
Expand Down
4 changes: 0 additions & 4 deletions tests/run-tasty-inspector/stdlibExperimentalDefinitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,11 @@ val experimentalDefinitionInLibrary = Set(
"scala.annotation.retainsCap",
"scala.Pure",
"scala.caps.CapSet",
"scala.caps.Capability",
"scala.caps.Classifier",
"scala.caps.Contains",
"scala.caps.Contains$",
"scala.caps.Contains$.containsImpl",
"scala.caps.Exists",
"scala.caps.Mutable",
"scala.caps.Sharable",
"scala.caps.Control",
"scala.caps.consume",
"scala.caps.internal",
"scala.caps.internal$",
Expand Down
Loading