@@ -159,7 +159,7 @@ object CheckCaptures:
159
159
def showInOpenedFreshBinders (mts : List [MethodType ]): String = mts match
160
160
case Nil => i " the part $t of "
161
161
case mt :: mts1 =>
162
- CCState . inNewExistentialScope(mt):
162
+ inNewExistentialScope(mt):
163
163
showInOpenedFreshBinders(mts1)
164
164
showInOpenedFreshBinders(openScopes.reverse)
165
165
report.error(
@@ -1160,8 +1160,8 @@ class CheckCaptures extends Recheck, SymTransformer:
1160
1160
checkSubset(localSet, thisSet, tree.srcPos) // (2)
1161
1161
for param <- cls.paramGetters do
1162
1162
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`
1165
1165
checkSubset(param.termRef.captureSet, thisSet, param.srcPos) // (3)
1166
1166
for pureBase <- cls.pureBaseClass do // (4)
1167
1167
def selfTypeTree = impl.body
@@ -1711,7 +1711,7 @@ class CheckCaptures extends Recheck, SymTransformer:
1711
1711
def traverse (t : Tree )(using Context ) =
1712
1712
t match
1713
1713
case t : Template =>
1714
- ignoringFreshLevels :
1714
+ withCollapsedFresh :
1715
1715
checkAllOverrides(ctx.owner.asClass, OverridingPairsCheckerCC (_, _, t))
1716
1716
case _ =>
1717
1717
traverseChildren(t)
@@ -1915,9 +1915,8 @@ class CheckCaptures extends Recheck, SymTransformer:
1915
1915
val normArgs = args.lazyZip(tl.paramInfos).map: (arg, bounds) =>
1916
1916
arg.withType(arg.nuType.forceBoxStatus(
1917
1917
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)
1921
1920
if ccConfig.postCheckCapturesets then
1922
1921
args.lazyZip(tl.paramNames).foreach(checkTypeParam(_, _, fun.symbol))
1923
1922
case _ =>
@@ -1936,9 +1935,8 @@ class CheckCaptures extends Recheck, SymTransformer:
1936
1935
case tree : InferredTypeTree =>
1937
1936
case tree : New =>
1938
1937
case tree : TypeTree =>
1939
- CCState .withCapAsRoot:
1940
- CCState .ignoringFreshLevels:
1941
- checkAppliedTypesIn(tree.withType(tree.nuType))
1938
+ withCollapsedFresh :
1939
+ checkAppliedTypesIn(tree.withType(tree.nuType))
1942
1940
case _ => traverseChildren(t)
1943
1941
checkApplied.traverse(unit)
1944
1942
end postCheck
0 commit comments