@@ -18,14 +18,13 @@ import util.{SimpleIdentitySet, EqHashMap, EqHashSet, SrcPos, Property}
1818import transform .{Recheck , PreRecheck , CapturedVars }
1919import Recheck .*
2020import scala .collection .mutable
21- import CaptureSet .{withCaptureSetsExplained , IncludeFailure , ExistentialSubsumesFailure }
21+ import CaptureSet .{withCaptureSetsExplained , IncludeFailure , ExistentialSubsumesFailure , MutAdaptFailure }
2222import CCState .*
2323import StdNames .nme
2424import NameKinds .{DefaultGetterName , WildcardParamName , UniqueNameKind }
2525import reporting .{trace , Message , OverrideError }
2626import Annotations .Annotation
2727import Capabilities .*
28- import dotty .tools .dotc .cc .CaptureSet .MutAdaptFailure
2928import dotty .tools .dotc .util .common .alwaysTrue
3029
3130/** The capture checker */
@@ -2009,13 +2008,13 @@ class CheckCaptures extends Recheck, SymTransformer:
20092008 else if isOfNestedMethod(env) then env.owner.owner
20102009 else if env.owner.isStaticOwner then NoSymbol
20112010 else boxedOwner(nextEnvToCharge(env, alwaysTrue))
2012-
2011+
20132012 def checkUseUnlessBoxed (c : Capability , croot : NamedType ) =
20142013 if ! boxedOwner(env).isContainedIn(croot.symbol.owner) then
20152014 checkUseDeclared(c, tree.srcPos)
2016-
2015+
20172016 def check (cs : CaptureSet ): Unit = cs.elems.foreach(checkElem)
2018-
2017+
20192018 def checkElem (c : Capability ): Unit =
20202019 if ! seen.contains(c) then
20212020 seen += c
@@ -2033,11 +2032,11 @@ class CheckCaptures extends Recheck, SymTransformer:
20332032 case c : FreshCap =>
20342033 check(c.hiddenSet)
20352034 case _ =>
2036-
2035+
20372036 check(uses)
20382037 end for
20392038 end checkEscapingUses
2040-
2039+
20412040 /** Check that arguments of TypeApplys and AppliedTypes conform to their bounds.
20422041 */
20432042 def postCheck (unit : tpd.Tree )(using Context ): Unit =
0 commit comments