@@ -3579,16 +3579,6 @@ object Types {
3579
3579
private var myDependencyStatus : DependencyStatus = Unknown
3580
3580
private var myParamDependencyStatus : DependencyStatus = Unknown
3581
3581
3582
- private def refersToParam (ann : Annotation )(using Context ): Boolean = ann match
3583
- case ConcreteAnnotation (tree) =>
3584
- tree.existsSubTree {
3585
- case id : Ident => id.tpe match
3586
- case TermParamRef (`thisLambdaType`, _) => true
3587
- case _ => false
3588
- case _ => false
3589
- }
3590
- case _ => false
3591
-
3592
3582
private def depStatus (initial : DependencyStatus , tp : Type )(using Context ): DependencyStatus =
3593
3583
class DepAcc extends TypeAccumulator [DependencyStatus ]:
3594
3584
def apply (status : DependencyStatus , tp : Type ) = compute(status, tp, this )
@@ -3615,7 +3605,7 @@ object Types {
3615
3605
case tp : TypeVar if ! tp.isInstantiated => combine(status, Provisional )
3616
3606
case tp : TermParamRef if tp.binder eq thisLambdaType => TrueDeps
3617
3607
case AnnotatedType (parent, ann) =>
3618
- if refersToParam( ann) then TrueDeps else compute(status, parent, theAcc)
3608
+ if ann.refersToParamOf(thisLambdaType ) then TrueDeps else compute(status, parent, theAcc)
3619
3609
case _ : ThisType | _ : BoundType | NoPrefix => status
3620
3610
case _ =>
3621
3611
(if theAcc != null then theAcc else DepAcc ()).foldOver(status, tp)
@@ -3670,7 +3660,7 @@ object Types {
3670
3660
def apply (tp : Type ) = tp match {
3671
3661
case tp @ TermParamRef (`thisLambdaType`, _) =>
3672
3662
range(defn.NothingType , atVariance(1 )(apply(tp.underlying)))
3673
- case AnnotatedType (parent, ann) if refersToParam( ann) =>
3663
+ case AnnotatedType (parent, ann) if ann.refersToParamOf(thisLambdaType ) =>
3674
3664
mapOver(parent)
3675
3665
case _ => mapOver(tp)
3676
3666
}
0 commit comments