@@ -115,7 +115,7 @@ object Types {
115115 private def testProvisional (using Context ): Boolean =
116116 class ProAcc extends TypeAccumulator [Boolean ]:
117117 override def apply (x : Boolean , t : Type ) = x || test(t, this )
118- def test (t : Type , theAcc : TypeAccumulator [Boolean ] | Null ): Boolean =
118+ def test (t : Type , theAcc : TypeAccumulator [Boolean ] @ retains(caps. * ) | Null ): Boolean =
119119 if t.mightBeProvisional then
120120 t.mightBeProvisional = t match
121121 case t : TypeRef =>
@@ -3773,7 +3773,7 @@ object Types {
37733773 val status = (x & StatusMask ) max (y & StatusMask )
37743774 val provisional = (x | y) & Provisional
37753775 (if status == TrueDeps then status else status | provisional).toByte
3776- def compute (status : DependencyStatus , tp : Type , theAcc : TypeAccumulator [DependencyStatus ] | Null ): DependencyStatus =
3776+ def compute (status : DependencyStatus , tp : Type , theAcc : TypeAccumulator [DependencyStatus ] @ retains(caps. * ) | Null ): DependencyStatus =
37773777 def applyPrefix (tp : NamedType ) =
37783778 if tp.isInstanceOf [SingletonType ] && tp.currentSymbol.isStatic
37793779 then status // Note: a type ref with static symbol can still be dependent since the symbol might be refined in the enclosing type. See pos/15331.scala.
@@ -4351,7 +4351,7 @@ object Types {
43514351 private var myEvalRunId : RunId = NoRunId
43524352 private var myEvalued : Type = uninitialized
43534353
4354- def isGround (acc : TypeAccumulator [Boolean ])(using Context ): Boolean =
4354+ def isGround (acc : TypeAccumulator [Boolean ] @ retains(caps. * ) )(using Context ): Boolean =
43554355 if myGround == 0 then myGround = if acc.foldOver(true , this ) then 1 else - 1
43564356 myGround > 0
43574357
@@ -5750,7 +5750,7 @@ object Types {
57505750 }
57515751 }
57525752
5753- private def treeTypeMap = new TreeTypeMap (typeMap = this )
5753+ private def treeTypeMap = new TreeTypeMap (typeMap = this .detach )
57545754
57555755 def mapOver (syms : List [Symbol ]): List [Symbol ] = mapSymbols(syms, treeTypeMap)
57565756
0 commit comments