@@ -115,7 +115,7 @@ sealed abstract class CaptureSet extends Showable:
115115 * capture set.
116116 */
117117 protected final def addNewElem (elem : CaptureRef )(using Context , VarState ): CompareResult =
118- if elem.isRootCapability || summon[VarState ] == FrozenState then
118+ if elem.isMaxCapability || summon[VarState ] == FrozenState then
119119 addThisElem(elem)
120120 else
121121 addThisElem(elem).orElse:
@@ -167,11 +167,11 @@ sealed abstract class CaptureSet extends Showable:
167167 if comparer.isInstanceOf [ExplainingTypeComparer ] then // !!! DEBUG
168168 reporting.trace.force(i " $this accountsFor $x, ${x.captureSetOfInfo}? " , show = true ):
169169 elems.exists(_.subsumes(x))
170- || ! x.isRootCapability && x.captureSetOfInfo.subCaptures(this , frozen = true ).isOK
170+ || ! x.isMaxCapability && x.captureSetOfInfo.subCaptures(this , frozen = true ).isOK
171171 else
172172 reporting.trace(i " $this accountsFor $x, ${x.captureSetOfInfo}? " , show = true ):
173173 elems.exists(_.subsumes(x))
174- || ! x.isRootCapability && x.captureSetOfInfo.subCaptures(this , frozen = true ).isOK
174+ || ! x.isMaxCapability && x.captureSetOfInfo.subCaptures(this , frozen = true ).isOK
175175
176176 /** A more optimistic version of accountsFor, which does not take variable supersets
177177 * of the `x` reference into account. A set might account for `x` if it accounts
@@ -183,7 +183,7 @@ sealed abstract class CaptureSet extends Showable:
183183 def mightAccountFor (x : CaptureRef )(using Context ): Boolean =
184184 reporting.trace(i " $this mightAccountFor $x, ${x.captureSetOfInfo}? " , show = true ) {
185185 elems.exists(_.subsumes(x))
186- || ! x.isRootCapability
186+ || ! x.isMaxCapability
187187 && {
188188 val elems = x.captureSetOfInfo.elems
189189 ! elems.isEmpty && elems.forall(mightAccountFor)
@@ -1032,7 +1032,7 @@ object CaptureSet:
10321032
10331033 /** The capture set of the type underlying CaptureRef */
10341034 def ofInfo (ref : CaptureRef )(using Context ): CaptureSet = ref match
1035- case ref : TermRef if ref.isRootCapability => ref.singletonCaptureSet
1035+ case ref : ( TermRef | TermParamRef ) if ref.isMaxCapability => ref.singletonCaptureSet
10361036 case ReachCapability (ref1) => deepCaptureSet(ref1.widen)
10371037 .showing(i " Deep capture set of $ref: ${ref1.widen} = $result" , capt)
10381038 case _ => ofType(ref.underlying, followResult = true )
0 commit comments