-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -22,43 +22,58 @@ import annotation.{experimental, compileTimeOnly, retainsCap} | |||
* But even without capture checking, extending this trait can be useful for documenting the intended purpose | ||||
* of a class. | ||||
* | ||||
* Capability has exactly two subtraits: Shared and Exclusive. | ||||
* Capability has exactly two subtraits: [[SharedCapability Shared]] and [[ExclusiveCapability Exclusive]]. | ||||
*/ | ||||
@experimental | ||||
sealed 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 | ||||
* as classifier capbilities. | ||||
* | ||||
* [[Classifier]] has a formal meaning when | ||||
* [[scala.language.experimental.captureChecking Capture Checking]] | ||||
* is turned on. It should not be used outside of capture checking. | ||||
*/ | ||||
@experimental | ||||
trait Classifier | ||||
|
||||
/** The universal capture reference. */ | ||||
@experimental | ||||
object cap extends Capability | ||||
|
||||
/** Marker trait for capabilities that can be safely shared in a concurrent context. | ||||
* | ||||
* [[SharedCapability]] has a formal meaning when | ||||
* [[scala.language.experimental.captureChecking Capture Checking]] | ||||
* is turned on. | ||||
* During separation checking, shared capabilities are not taken into account. | ||||
*/ | ||||
@experimental | ||||
trait SharedCapability extends Capability, Classifier | ||||
|
||||
@experimental | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not remove the experimental from this alias too?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to remove experimental here, and we want to work a bit with it to see whether it is a good idea to have a short alias. |
||||
type Shared = SharedCapability | ||||
|
||||
/** Marker trait for exclusive capabilities that are separation-checked | ||||
/** Marker trait for capabilities that should only be used by one concurrent process | ||||
* at a given time. For example, write-access to a shared mutable buffer. | ||||
* | ||||
* [[ExclusiveCapability]] has a formal meaning when | ||||
* [[scala.language.experimental.captureChecking Capture Checking]] | ||||
* is turned on. | ||||
* During separation checking, exclusive usage of marked capabilities will be enforced. | ||||
*/ | ||||
@experimental | ||||
trait ExclusiveCapability extends Capability, Classifier | ||||
|
||||
@experimental | ||||
type Exclusive = ExclusiveCapability | ||||
|
||||
/** Base trait for capabilities that capture some continuation or return point in | ||||
* the stack. Examples are exceptions, labels, Async, CanThrow. | ||||
/** Marker trait for capabilities that capture some continuation or return point in | ||||
* the stack. Examples are exceptions, [[scala.util.boundary.Label labels]], [[scala.CanThrow CanThrow]] | ||||
* or Async contexts. | ||||
* | ||||
* [[Control]] has a formal meaning when | ||||
* [[scala.language.experimental.captureChecking Capture Checking]] | ||||
* is turned on. | ||||
*/ | ||||
@experimental | ||||
trait Control extends SharedCapability, Classifier | ||||
|
||||
/** Marker trait for classes with methods that require an exclusive reference. */ | ||||
|
Uh oh!
There was an error while loading. Please reload this page.