@@ -400,12 +400,10 @@ object Types {
400
400
* satisfy predicate `p`.
401
401
*
402
402
* @param p The predicate to satisfy
403
- * @param excludeLowerBounds If set to true, the lower bounds of abstract
404
- * types will be ignored.
405
403
*/
406
- def namedPartsWith (p : NamedType => Boolean , excludeLowerBounds : Boolean = false )
404
+ def namedPartsWith (p : NamedType => Boolean )
407
405
(using Context ): collection.Set [NamedType ] =
408
- new NamedPartsAccumulator (p, excludeLowerBounds ).apply(mutable.LinkedHashSet (), this )
406
+ new NamedPartsAccumulator (p).apply(mutable.LinkedHashSet (), this )
409
407
410
408
/** Map function `f` over elements of an AndType, rebuilding with function `g` */
411
409
def mapReduceAnd [T ](f : Type => T )(g : (T , T ) => T )(using Context ): T = stripTypeVar match {
@@ -5520,9 +5518,8 @@ object Types {
5520
5518
override def hash (x : Type ): Int = System .identityHashCode(x)
5521
5519
override def isEqual (x : Type , y : Type ) = x.eq(y)
5522
5520
5523
- class NamedPartsAccumulator (p : NamedType => Boolean , excludeLowerBounds : Boolean = false )
5524
- (using Context ) extends TypeAccumulator [mutable.Set [NamedType ]] {
5525
- override def stopAtStatic : Boolean = false
5521
+ class NamedPartsAccumulator (p : NamedType => Boolean )(using Context )
5522
+ extends TypeAccumulator [mutable.Set [NamedType ]] {
5526
5523
def maybeAdd (x : mutable.Set [NamedType ], tp : NamedType ): mutable.Set [NamedType ] = if (p(tp)) x += tp else x
5527
5524
val seen = TypeHashSet ()
5528
5525
def apply (x : mutable.Set [NamedType ], tp : Type ): mutable.Set [NamedType ] =
@@ -5541,7 +5538,7 @@ object Types {
5541
5538
case tp : AppliedType =>
5542
5539
foldOver(x, tp)
5543
5540
case TypeBounds (lo, hi) =>
5544
- if ( ! excludeLowerBounds) apply(x, lo)
5541
+ apply(x, lo)
5545
5542
apply(x, hi)
5546
5543
case tp : ParamRef =>
5547
5544
apply(x, tp.underlying)
0 commit comments