@@ -22,13 +22,17 @@ import annotation.{experimental, compileTimeOnly, retainsCap}
2222 * But even without capture checking, extending this trait can be useful for documenting the intended purpose
2323 * of a class.
2424 *
25- * Capability has exactly two subtraits: Shared and Exclusive.
25+ * Capability has exactly two subtraits: [[ SharedCapability Shared]] and [[ ExclusiveCapability Exclusive]] .
2626 */
2727sealed trait Capability extends Any
2828
2929/** A marker trait for classifier capabilities that can appear in `.only`
3030 * qualifiers. Capability classes directly extending `Classifier` are treated
31- * as classifier capbilities
31+ * as classifier capbilities.
32+ *
33+ * [[Classifier ]] has a formal meaning when
34+ * [[scala.language.experimental.captureChecking Capture Checking ]]
35+ * is turned on. It should not be used outside of capture checking.
3236 */
3337trait Classifier
3438
@@ -37,23 +41,38 @@ trait Classifier
3741object cap extends Capability
3842
3943/** Marker trait for capabilities that can be safely shared in a concurrent context.
44+ *
45+ * [[SharedCapability ]] has a formal meaning when
46+ * [[scala.language.experimental.captureChecking Capture Checking ]]
47+ * is turned on.
4048 * During separation checking, shared capabilities are not taken into account.
4149 */
4250trait SharedCapability extends Capability , Classifier
4351
4452@ experimental
4553type Shared = SharedCapability
4654
47- /** Marker trait for exclusive capabilities that are separation-checked
55+ /** Marker trait for capabilities that should only be used by one concurrent process
56+ * at a given time. For example, write-access to a shared mutable buffer.
57+ *
58+ * [[ExclusiveCapability ]] has a formal meaning when
59+ * [[scala.language.experimental.captureChecking Capture Checking ]]
60+ * is turned on.
61+ * During separation checking, exclusive usage of marked capabilities will be enforced.
4862 */
4963@ experimental
5064trait ExclusiveCapability extends Capability , Classifier
5165
5266@ experimental
5367type Exclusive = ExclusiveCapability
5468
55- /** Base trait for capabilities that capture some continuation or return point in
56- * the stack. Examples are exceptions, labels, Async, CanThrow.
69+ /** Marker trait for capabilities that capture some continuation or return point in
70+ * the stack. Examples are exceptions, [[scala.util.boundary.Label labels ]], [[scala.CanThrow CanThrow ]]
71+ * or Async contexts.
72+ *
73+ * [[Control ]] has a formal meaning when
74+ * [[scala.language.experimental.captureChecking Capture Checking ]]
75+ * is turned on.
5776 */
5877trait Control extends SharedCapability , Classifier
5978
0 commit comments