@@ -422,8 +422,8 @@ object Types {
422422
423423 /** Returns true if there is a part of this type that satisfies predicate `p`.
424424 */
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 )
427427
428428 /** Returns true if all parts of this type satisfy predicate `p`.
429429 */
@@ -5686,11 +5686,12 @@ object Types {
56865686 protected def traverseChildren (tp : Type ): Unit = foldOver((), tp)
56875687 }
56885688
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 ]:
56915693 def apply (x : Boolean , tp : Type ): Boolean =
56925694 x || p(tp) || (forceLazy || ! tp.isInstanceOf [LazyRef ]) && foldOver(x, tp)
5693- }
56945695
56955696 class ForeachAccumulator (p : Type => Unit , override val stopAtStatic : Boolean )(using Context ) extends TypeAccumulator [Unit ] {
56965697 def apply (x : Unit , tp : Type ): Unit = foldOver(p(tp), tp)
0 commit comments