@@ -42,7 +42,7 @@ object Fresh:
4242 object Cap :
4343
4444 def apply (initialHidden : Refs = emptySet)(using Context ): CaptureRef =
45- if ccConfig.useFresh then
45+ if ccConfig.useSepChecks then
4646 AnnotatedType (defn.captureRoot.termRef, Annot (CaptureSet .HiddenSet (initialHidden)))
4747 else
4848 defn.captureRoot.termRef
@@ -61,20 +61,13 @@ object Fresh:
6161 class FromCap (owner : Symbol )(using Context ) extends BiTypeMap , FollowAliasesMap :
6262 thisMap =>
6363
64- var reach = false
65-
66- private def initHidden =
67- val ref = owner.termRef
68- if reach then
69- if ref.isTrackableRef then SimpleIdentitySet (ref.reach) else emptySet
70- else
71- if ref.isTracked then SimpleIdentitySet (ref) else emptySet
64+ private var reach = false
7265
7366 override def apply (t : Type ) =
7467 if variance <= 0 then t
7568 else t match
7669 case t : CaptureRef if t.isCap =>
77- Cap (initHidden )
70+ Cap (ownerToHidden(owner, reach) )
7871 case t @ CapturingType (_, refs) =>
7972 val savedReach = reach
8073 if t.isBoxed then reach = true
@@ -103,11 +96,11 @@ object Fresh:
10396
10497 /** Maps cap to fresh */
10598 def fromCap (tp : Type , owner : Symbol = NoSymbol )(using Context ): Type =
106- if ccConfig.useFresh then FromCap (owner)(tp) else tp
99+ if ccConfig.useSepChecks then FromCap (owner)(tp) else tp
107100
108101 /** Maps fresh to cap */
109102 def toCap (tp : Type )(using Context ): Type =
110- if ccConfig.useFresh then FromCap (NoSymbol ).inverse(tp) else tp
103+ if ccConfig.useSepChecks then FromCap (NoSymbol ).inverse(tp) else tp
111104
112105 /** If `refs` contains an occurrence of `cap` or `cap.rd`, the current context
113106 * with an added property PrintFresh. This addition causes all occurrences of
0 commit comments