@@ -422,8 +422,8 @@ object Types {
422
422
423
423
/** Returns true if there is a part of this type that satisfies predicate `p`.
424
424
*/
425
- final def existsPart (p : Type => Boolean , forceLazy : Boolean = true )(using Context ): Boolean =
426
- new ExistsAccumulator (p, forceLazy).apply(false , this )
425
+ final def existsPart (p : Type => Boolean , stopAtStatic : Boolean = false , forceLazy : Boolean = true )(using Context ): Boolean =
426
+ new ExistsAccumulator (p, stopAtStatic, forceLazy).apply(false , this )
427
427
428
428
/** Returns true if all parts of this type satisfy predicate `p`.
429
429
*/
@@ -5686,11 +5686,12 @@ object Types {
5686
5686
protected def traverseChildren (tp : Type ): Unit = foldOver((), tp)
5687
5687
}
5688
5688
5689
- class ExistsAccumulator (p : Type => Boolean , forceLazy : Boolean = true )(using Context ) extends TypeAccumulator [Boolean ] {
5690
- override def stopAtStatic : Boolean = false
5689
+ class ExistsAccumulator (
5690
+ p : Type => Boolean ,
5691
+ override val stopAtStatic : Boolean ,
5692
+ forceLazy : Boolean )(using Context ) extends TypeAccumulator [Boolean ]:
5691
5693
def apply (x : Boolean , tp : Type ): Boolean =
5692
5694
x || p(tp) || (forceLazy || ! tp.isInstanceOf [LazyRef ]) && foldOver(x, tp)
5693
- }
5694
5695
5695
5696
class ForeachAccumulator (p : Type => Unit , override val stopAtStatic : Boolean )(using Context ) extends TypeAccumulator [Unit ] {
5696
5697
def apply (x : Unit , tp : Type ): Unit = foldOver(p(tp), tp)
0 commit comments