@@ -230,13 +230,13 @@ extension (tp: Type)
230230 * cannot be propagated between sets. If `a <: b` and `a` acquires `x?` then
231231 * `x` is propagated to `b` as a conservative approximation.
232232 *
233- * Maybe capabilities should only arise for caoture sets that appear in invariant
233+ * Maybe capabilities should only arise for capture sets that appear in invariant
234234 * position in their surrounding type. They are similar to TypeBunds types, but
235235 * restricted to capture sets. For instance,
236236 *
237237 * Array[C^{x?}]
238238 *
239- * should be morally equivaelent to
239+ * should be morally equivalent to
240240 *
241241 * Array[_ >: C^{} <: C^{x}]
242242 *
@@ -441,17 +441,21 @@ object ReachCapabilityApply:
441441 case Apply (reach, arg :: Nil ) if reach.symbol == defn.Caps_reachCapability => Some (arg)
442442 case _ => None
443443
444- /** An extractor for `ref @annotation.internal.reachCapability`, which is used to express
445- * the reach capability `ref*` as a type.
446- */
447444class AnnotatedCapability (annot : Context ?=> ClassSymbol ):
448445 def apply (tp : Type )(using Context ) =
449446 AnnotatedType (tp, Annotation (annot, util.Spans .NoSpan ))
450447 def unapply (tree : AnnotatedType )(using Context ): Option [SingletonCaptureRef ] = tree match
451448 case AnnotatedType (parent : SingletonCaptureRef , ann) if ann.symbol == annot => Some (parent)
452449 case _ => None
453450
451+ /** An extractor for `ref @annotation.internal.reachCapability`, which is used to express
452+ * the reach capability `ref*` as a type.
453+ */
454454object ReachCapability extends AnnotatedCapability (defn.ReachCapabilityAnnot )
455+
456+ /** An extractor for `ref @maybeCapability`, which is used to express
457+ * the maybe capability `ref?` as a type.
458+ */
455459object MaybeCapability extends AnnotatedCapability (defn.MaybeCapabilityAnnot )
456460
457461
0 commit comments