@@ -155,8 +155,7 @@ object Capabilities:
155155
156156 object FreshCap :
157157 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)
160159
161160 /** A root capability associated with a function type. These are conceptually
162161 * existentially quantified over the function's result type.
@@ -716,14 +715,12 @@ object Capabilities:
716715 * the map being installed for future use.
717716 */
718717 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)
723720
724721 /** Maps fresh to cap */
725722 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)
727724
728725 /** Map top-level free existential variables one-to-one to Fresh instances */
729726 def resultToFresh (tp : Type , origin : Origin )(using Context ): Type =
@@ -808,17 +805,14 @@ object Capabilities:
808805 case c @ ResultCap (`mt`) =>
809806 // do a reverse getOrElseUpdate on `seen` to produce the
810807 // `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
822816 case _ =>
823817 super .mapCapability(c, deep)
824818
0 commit comments