@@ -58,8 +58,7 @@ extension (tree: Tree)
58
58
tree.putAttachment(Captures , refs)
59
59
refs
60
60
61
- /** The type representing the capture set of retains annotation.
62
- */
61
+ /** The type representing the capture set of @retains, @retainsCap or @retainsByName annotation. */
63
62
def retainedSet (using Context ): Type =
64
63
tree match
65
64
case Apply (TypeApply (_, refs :: Nil ), _) => refs.tpe
@@ -93,8 +92,7 @@ extension (tp: Type)
93
92
if tp.isNothingType then Nil
94
93
else tp :: Nil // should be checked by wellformedness
95
94
96
- /** A list of capabilities tof a retained set.
97
- */
95
+ /** A list of capabilities of a retained set. */
98
96
def retainedElements (using Context ): List [Capability ] =
99
97
retainedElementsRaw.map(_.toCapability)
100
98
@@ -530,6 +528,9 @@ class CleanupRetains(using Context) extends TypeMap:
530
528
RetainingType (tp, defn.NothingType , byName = annot.symbol == defn.RetainsByNameAnnot )
531
529
case _ => mapOver(tp)
532
530
531
+ /** A base class for extractors that match annotated types with a specific
532
+ * Capability annotation.
533
+ */
533
534
abstract class AnnotatedCapability (annotCls : Context ?=> ClassSymbol ):
534
535
def apply (tp : Type )(using Context ): AnnotatedType =
535
536
AnnotatedType (tp, Annotation (annotCls, util.Spans .NoSpan ))
0 commit comments