@@ -155,8 +155,7 @@ object Capabilities:
155
155
156
156
object FreshCap :
157
157
def apply (origin : Origin )(using Context ): FreshCap | GlobalCap .type =
158
- if ccConfig.useSepChecks then FreshCap (ctx.owner, origin)
159
- else GlobalCap
158
+ FreshCap (ctx.owner, origin)
160
159
161
160
/** A root capability associated with a function type. These are conceptually
162
161
* existentially quantified over the function's result type.
@@ -716,14 +715,12 @@ object Capabilities:
716
715
* the map being installed for future use.
717
716
*/
718
717
def capToFresh (tp : Type , origin : Origin )(using Context ): Type =
719
- if ccConfig.useSepChecks then
720
- ccState.withoutMappedFutureElems:
721
- CapToFresh (origin)(tp)
722
- else tp
718
+ ccState.withoutMappedFutureElems:
719
+ CapToFresh (origin)(tp)
723
720
724
721
/** Maps fresh to cap */
725
722
def freshToCap (tp : Type )(using Context ): Type =
726
- if ccConfig.useSepChecks then CapToFresh (Origin .Unknown ).inverse(tp) else tp
723
+ CapToFresh (Origin .Unknown ).inverse(tp)
727
724
728
725
/** Map top-level free existential variables one-to-one to Fresh instances */
729
726
def resultToFresh (tp : Type , origin : Origin )(using Context ): Type =
@@ -808,17 +805,14 @@ object Capabilities:
808
805
case c @ ResultCap (`mt`) =>
809
806
// do a reverse getOrElseUpdate on `seen` to produce the
810
807
// `Fresh` assosicated with `t`
811
- if ! ccConfig.useSepChecks then
812
- FreshCap (Origin .Unknown ) // warning: this can cause cycles
813
- else
814
- val primary = c.primaryResultCap
815
- primary.origin match
816
- case GlobalCap =>
817
- val fresh = FreshCap (Origin .Unknown )
818
- primary.setOrigin(fresh)
819
- fresh
820
- case origin : FreshCap =>
821
- origin
808
+ val primary = c.primaryResultCap
809
+ primary.origin match
810
+ case GlobalCap =>
811
+ val fresh = FreshCap (Origin .Unknown )
812
+ primary.setOrigin(fresh)
813
+ fresh
814
+ case origin : FreshCap =>
815
+ origin
822
816
case _ =>
823
817
super .mapCapability(c, deep)
824
818
0 commit comments