@@ -115,7 +115,7 @@ object Types {
115
115
private def testProvisional (using Context ): Boolean =
116
116
class ProAcc extends TypeAccumulator [Boolean ]:
117
117
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 =
119
119
if t.mightBeProvisional then
120
120
t.mightBeProvisional = t match
121
121
case t : TypeRef =>
@@ -3773,7 +3773,7 @@ object Types {
3773
3773
val status = (x & StatusMask ) max (y & StatusMask )
3774
3774
val provisional = (x | y) & Provisional
3775
3775
(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 =
3777
3777
def applyPrefix (tp : NamedType ) =
3778
3778
if tp.isInstanceOf [SingletonType ] && tp.currentSymbol.isStatic
3779
3779
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 {
4351
4351
private var myEvalRunId : RunId = NoRunId
4352
4352
private var myEvalued : Type = uninitialized
4353
4353
4354
- def isGround (acc : TypeAccumulator [Boolean ])(using Context ): Boolean =
4354
+ def isGround (acc : TypeAccumulator [Boolean ] @ retains(caps. * ) )(using Context ): Boolean =
4355
4355
if myGround == 0 then myGround = if acc.foldOver(true , this ) then 1 else - 1
4356
4356
myGround > 0
4357
4357
@@ -5750,7 +5750,7 @@ object Types {
5750
5750
}
5751
5751
}
5752
5752
5753
- private def treeTypeMap = new TreeTypeMap (typeMap = this )
5753
+ private def treeTypeMap = new TreeTypeMap (typeMap = this .detach )
5754
5754
5755
5755
def mapOver (syms : List [Symbol ]): List [Symbol ] = mapSymbols(syms, treeTypeMap)
5756
5756
0 commit comments