Skip to content

Commit 4d71cf8

Browse files
committed
Tweak retainedSet
1 parent 70192c0 commit 4d71cf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ extension (tree: Tree)
6666
refs
6767

6868
/** The type representing the capture set of @retains, @retainsCap or @retainsByName annotation. */
69-
def retainedSet(using Context): Type = {
70-
if tree.symbol.maybeOwner == defn.RetainsCapAnnot then
69+
def retainedSet(using Context): Type =
70+
val rcap = defn.RetainsCapAnnot
71+
if tree.symbol == rcap || tree.symbol.maybeOwner == rcap then
7172
defn.captureRoot.termRef
7273
else tree match
7374
case Apply(TypeApply(_, refs :: Nil), _) => refs.tpe
@@ -76,7 +77,6 @@ extension (tree: Tree)
7677
case AppliedType(_, refs :: Nil) => refs
7778
case _ => NoType
7879
case _ => NoType
79-
}//.showing(i"retained from $tree = $result")
8080

8181
extension (tp: Type)
8282

0 commit comments

Comments
 (0)