@@ -552,7 +552,7 @@ trait ConstraintHandling {
552552
553553 private def isTransparent (tp : Type )(using Context ): Boolean = tp match
554554 case AndType (tp1, tp2) => isTransparent(tp1) && isTransparent(tp2)
555- case _ => tp.typeSymbol.isTransparentTrait && ! tp.isLambdaSub
555+ case _ => tp.typeSymbol.isTransparentClass && ! tp.isLambdaSub
556556
557557 /** If `tp` is an intersection such that some operands are transparent trait instances
558558 * and others are not, replace as many transparent trait instances as possible with Any
@@ -561,28 +561,28 @@ trait ConstraintHandling {
561561 * types (since in this case the type was not a true intersection of transparent traits
562562 * and other types to start with).
563563 */
564- def dropTransparentTraits (tp : Type , bound : Type )(using Context ): Type =
564+ def dropTransparentClasses (tp : Type , bound : Type )(using Context ): Type =
565565 var kept : Set [Type ] = Set () // types to keep since otherwise bound would not fit
566566 var dropped : List [Type ] = List () // the types dropped so far, last one on top
567567
568- def dropOneTransparentTrait (tp : Type ): Type =
568+ def dropOneTransparentClass (tp : Type ): Type =
569569 val tpd = tp.dealias
570570 if isTransparent(tpd) && ! kept.contains(tpd) then
571571 dropped = tpd :: dropped
572572 defn.AnyType
573573 else tpd match
574574 case AndType (tp1, tp2) =>
575- val tp1w = dropOneTransparentTrait (tp1)
575+ val tp1w = dropOneTransparentClass (tp1)
576576 if tp1w ne tp1 then tp1w & tp2
577577 else
578- val tp2w = dropOneTransparentTrait (tp2)
578+ val tp2w = dropOneTransparentClass (tp2)
579579 if tp2w ne tp2 then tp1 & tp2w
580580 else tpd
581581 case _ =>
582582 tp
583583
584584 def recur (tp : Type ): Type =
585- val tpw = dropOneTransparentTrait (tp)
585+ val tpw = dropOneTransparentClass (tp)
586586 if tpw eq tp then tp
587587 else if tpw <:< bound then recur(tpw)
588588 else
@@ -599,7 +599,7 @@ trait ConstraintHandling {
599599 tp
600600 else
601601 tpw
602- end dropTransparentTraits
602+ end dropTransparentClasses
603603
604604 /** If `tp` is an applied match type alias which is also an unreducible application
605605 * of a higher-kinded type to a wildcard argument, widen to the match type's bound,
@@ -625,7 +625,7 @@ trait ConstraintHandling {
625625 * union type (except for unions | Null, which are kept in the state they were).
626626 * 3. Widen some irreducible applications of higher-kinded types to wildcard arguments
627627 * (see @widenIrreducible).
628- * 4. Drop transparent traits from intersections (see @dropTransparentTraits ).
628+ * 4. Drop transparent traits from intersections (see @dropTransparentClasses ).
629629 *
630630 * Don't do these widenings if `bound` is a subtype of `scala.Singleton`.
631631 * Also, if the result of these widenings is a TypeRef to a module class,
@@ -659,7 +659,7 @@ trait ConstraintHandling {
659659 if (widenedFromUnion ne widenedFromSingle) && isTransparent(widenedFromUnion) then
660660 widenedFromSingle
661661 else
662- dropTransparentTraits (widenedFromUnion, bound)
662+ dropTransparentClasses (widenedFromUnion, bound)
663663 widenIrreducible(widened)
664664
665665 wideInst match
0 commit comments