Skip to content

Commit 0f49ba4

Browse files
committed
Simplify accountsFor
1 parent 5abcecd commit 0f49ba4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ sealed abstract class CaptureSet extends Showable:
191191
existsElem(elems, _.subsumes(x))
192192
|| !x.isMaxCapability
193193
&& !x.derivesFrom(defn.Caps_CapSet)
194-
&& x.captureSetOfInfo.subCaptures(this)(using ctx,
195-
vs match
196-
case vs: FrozenVarState => vs
197-
case _ => FrozenVarState()).isOK
194+
&& x.captureSetOfInfo.subCaptures(this, Frozen.All).isOK
198195

199196
comparer match
200197
case comparer: ExplainingTypeComparer => comparer.traceIndented(debugInfo)(test)
@@ -1044,7 +1041,7 @@ object CaptureSet:
10441041
class VarState:
10451042

10461043
/** A map from captureset variables to their elements at the time of the snapshot. */
1047-
private val elemsMap: util.EqHashMap[Var, Refs] = new util.EqHashMap
1044+
protected val elemsMap: util.EqHashMap[Var, Refs] = new util.EqHashMap
10481045

10491046
/** A map from captureset variables to their dependent sets at the time of the snapshot. */
10501047
private val depsMap: util.EqHashMap[Var, Deps] = new util.EqHashMap
@@ -1102,6 +1099,7 @@ object CaptureSet:
11021099
class FrozenVarState extends VarState:
11031100
override def putElems(v: Var, refs: Refs) = false
11041101
override def putDeps(v: Var, deps: Deps) = false
1102+
override def putHidden(v: HiddenSet, elems: Refs): Boolean = { elemsMap(v) = elems; true }
11051103

11061104
@sharable
11071105
/** A frozen state that allows a Fresh.Cap instancce to subsume a

0 commit comments

Comments
 (0)