@@ -18,14 +18,13 @@ import util.{SimpleIdentitySet, EqHashMap, EqHashSet, SrcPos, Property}
18
18
import transform .{Recheck , PreRecheck , CapturedVars }
19
19
import Recheck .*
20
20
import scala .collection .mutable
21
- import CaptureSet .{withCaptureSetsExplained , IncludeFailure , ExistentialSubsumesFailure }
21
+ import CaptureSet .{withCaptureSetsExplained , IncludeFailure , ExistentialSubsumesFailure , MutAdaptFailure }
22
22
import CCState .*
23
23
import StdNames .nme
24
24
import NameKinds .{DefaultGetterName , WildcardParamName , UniqueNameKind }
25
25
import reporting .{trace , Message , OverrideError }
26
26
import Annotations .Annotation
27
27
import Capabilities .*
28
- import dotty .tools .dotc .cc .CaptureSet .MutAdaptFailure
29
28
import dotty .tools .dotc .util .common .alwaysTrue
30
29
31
30
/** The capture checker */
@@ -2009,13 +2008,13 @@ class CheckCaptures extends Recheck, SymTransformer:
2009
2008
else if isOfNestedMethod(env) then env.owner.owner
2010
2009
else if env.owner.isStaticOwner then NoSymbol
2011
2010
else boxedOwner(nextEnvToCharge(env, alwaysTrue))
2012
-
2011
+
2013
2012
def checkUseUnlessBoxed (c : Capability , croot : NamedType ) =
2014
2013
if ! boxedOwner(env).isContainedIn(croot.symbol.owner) then
2015
2014
checkUseDeclared(c, tree.srcPos)
2016
-
2015
+
2017
2016
def check (cs : CaptureSet ): Unit = cs.elems.foreach(checkElem)
2018
-
2017
+
2019
2018
def checkElem (c : Capability ): Unit =
2020
2019
if ! seen.contains(c) then
2021
2020
seen += c
@@ -2033,11 +2032,11 @@ class CheckCaptures extends Recheck, SymTransformer:
2033
2032
case c : FreshCap =>
2034
2033
check(c.hiddenSet)
2035
2034
case _ =>
2036
-
2035
+
2037
2036
check(uses)
2038
2037
end for
2039
2038
end checkEscapingUses
2040
-
2039
+
2041
2040
/** Check that arguments of TypeApplys and AppliedTypes conform to their bounds.
2042
2041
*/
2043
2042
def postCheck (unit : tpd.Tree )(using Context ): Unit =
0 commit comments