@@ -42,7 +42,7 @@ object Fresh:
42
42
object Cap :
43
43
44
44
def apply (initialHidden : Refs = emptySet)(using Context ): CaptureRef =
45
- if ccConfig.useFresh then
45
+ if ccConfig.useSepChecks then
46
46
AnnotatedType (defn.captureRoot.termRef, Annot (CaptureSet .HiddenSet (initialHidden)))
47
47
else
48
48
defn.captureRoot.termRef
@@ -61,20 +61,13 @@ object Fresh:
61
61
class FromCap (owner : Symbol )(using Context ) extends BiTypeMap , FollowAliasesMap :
62
62
thisMap =>
63
63
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
72
65
73
66
override def apply (t : Type ) =
74
67
if variance <= 0 then t
75
68
else t match
76
69
case t : CaptureRef if t.isCap =>
77
- Cap (initHidden )
70
+ Cap (ownerToHidden(owner, reach) )
78
71
case t @ CapturingType (_, refs) =>
79
72
val savedReach = reach
80
73
if t.isBoxed then reach = true
@@ -103,11 +96,11 @@ object Fresh:
103
96
104
97
/** Maps cap to fresh */
105
98
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
107
100
108
101
/** Maps fresh to cap */
109
102
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
111
104
112
105
/** If `refs` contains an occurrence of `cap` or `cap.rd`, the current context
113
106
* with an added property PrintFresh. This addition causes all occurrences of
0 commit comments