@@ -159,7 +159,7 @@ object CheckCaptures:
159159 def showInOpenedFreshBinders (mts : List [MethodType ]): String = mts match
160160 case Nil => i " the part $t of "
161161 case mt :: mts1 =>
162- CCState . inNewExistentialScope(mt):
162+ inNewExistentialScope(mt):
163163 showInOpenedFreshBinders(mts1)
164164 showInOpenedFreshBinders(openScopes.reverse)
165165 report.error(
@@ -1160,8 +1160,8 @@ class CheckCaptures extends Recheck, SymTransformer:
11601160 checkSubset(localSet, thisSet, tree.srcPos) // (2)
11611161 for param <- cls.paramGetters do
11621162 if ! param.hasAnnotation(defn.ConstructorOnlyAnnot )
1163- && ! param.hasAnnotation(defn.UntrackedCapturesAnnot ) then
1164- CCState . withCapAsRoot: // OK? We need this here since self types use `cap` instead of `fresh`
1163+ && ! param.hasAnnotation(defn.UntrackedCapturesAnnot ) then
1164+ withCapAsRoot : // OK? We need this here since self types use `cap` instead of `fresh`
11651165 checkSubset(param.termRef.captureSet, thisSet, param.srcPos) // (3)
11661166 for pureBase <- cls.pureBaseClass do // (4)
11671167 def selfTypeTree = impl.body
@@ -1711,7 +1711,7 @@ class CheckCaptures extends Recheck, SymTransformer:
17111711 def traverse (t : Tree )(using Context ) =
17121712 t match
17131713 case t : Template =>
1714- ignoringFreshLevels :
1714+ withCollapsedFresh :
17151715 checkAllOverrides(ctx.owner.asClass, OverridingPairsCheckerCC (_, _, t))
17161716 case _ =>
17171717 traverseChildren(t)
@@ -1915,9 +1915,8 @@ class CheckCaptures extends Recheck, SymTransformer:
19151915 val normArgs = args.lazyZip(tl.paramInfos).map: (arg, bounds) =>
19161916 arg.withType(arg.nuType.forceBoxStatus(
19171917 bounds.hi.isBoxedCapturing | bounds.lo.isBoxedCapturing))
1918- CCState .withCapAsRoot: // OK? We need this since bounds use `cap` instead of `fresh`
1919- CCState .ignoringFreshLevels:
1920- checkBounds(normArgs, tl)
1918+ withCollapsedFresh : // OK? We need this since bounds use `cap` instead of `fresh`
1919+ checkBounds(normArgs, tl)
19211920 if ccConfig.postCheckCapturesets then
19221921 args.lazyZip(tl.paramNames).foreach(checkTypeParam(_, _, fun.symbol))
19231922 case _ =>
@@ -1936,9 +1935,8 @@ class CheckCaptures extends Recheck, SymTransformer:
19361935 case tree : InferredTypeTree =>
19371936 case tree : New =>
19381937 case tree : TypeTree =>
1939- CCState .withCapAsRoot:
1940- CCState .ignoringFreshLevels:
1941- checkAppliedTypesIn(tree.withType(tree.nuType))
1938+ withCollapsedFresh :
1939+ checkAppliedTypesIn(tree.withType(tree.nuType))
19421940 case _ => traverseChildren(t)
19431941 checkApplied.traverse(unit)
19441942 end postCheck
0 commit comments