@@ -552,7 +552,7 @@ trait ConstraintHandling {
552
552
553
553
private def isTransparent (tp : Type )(using Context ): Boolean = tp match
554
554
case AndType (tp1, tp2) => isTransparent(tp1) && isTransparent(tp2)
555
- case _ => tp.typeSymbol.isTransparentTrait && ! tp.isLambdaSub
555
+ case _ => tp.typeSymbol.isTransparentClass && ! tp.isLambdaSub
556
556
557
557
/** If `tp` is an intersection such that some operands are transparent trait instances
558
558
* and others are not, replace as many transparent trait instances as possible with Any
@@ -561,28 +561,28 @@ trait ConstraintHandling {
561
561
* types (since in this case the type was not a true intersection of transparent traits
562
562
* and other types to start with).
563
563
*/
564
- def dropTransparentTraits (tp : Type , bound : Type )(using Context ): Type =
564
+ def dropTransparentClasses (tp : Type , bound : Type )(using Context ): Type =
565
565
var kept : Set [Type ] = Set () // types to keep since otherwise bound would not fit
566
566
var dropped : List [Type ] = List () // the types dropped so far, last one on top
567
567
568
- def dropOneTransparentTrait (tp : Type ): Type =
568
+ def dropOneTransparentClass (tp : Type ): Type =
569
569
val tpd = tp.dealias
570
570
if isTransparent(tpd) && ! kept.contains(tpd) then
571
571
dropped = tpd :: dropped
572
572
defn.AnyType
573
573
else tpd match
574
574
case AndType (tp1, tp2) =>
575
- val tp1w = dropOneTransparentTrait (tp1)
575
+ val tp1w = dropOneTransparentClass (tp1)
576
576
if tp1w ne tp1 then tp1w & tp2
577
577
else
578
- val tp2w = dropOneTransparentTrait (tp2)
578
+ val tp2w = dropOneTransparentClass (tp2)
579
579
if tp2w ne tp2 then tp1 & tp2w
580
580
else tpd
581
581
case _ =>
582
582
tp
583
583
584
584
def recur (tp : Type ): Type =
585
- val tpw = dropOneTransparentTrait (tp)
585
+ val tpw = dropOneTransparentClass (tp)
586
586
if tpw eq tp then tp
587
587
else if tpw <:< bound then recur(tpw)
588
588
else
@@ -599,7 +599,7 @@ trait ConstraintHandling {
599
599
tp
600
600
else
601
601
tpw
602
- end dropTransparentTraits
602
+ end dropTransparentClasses
603
603
604
604
/** If `tp` is an applied match type alias which is also an unreducible application
605
605
* of a higher-kinded type to a wildcard argument, widen to the match type's bound,
@@ -625,7 +625,7 @@ trait ConstraintHandling {
625
625
* union type (except for unions | Null, which are kept in the state they were).
626
626
* 3. Widen some irreducible applications of higher-kinded types to wildcard arguments
627
627
* (see @widenIrreducible).
628
- * 4. Drop transparent traits from intersections (see @dropTransparentTraits ).
628
+ * 4. Drop transparent traits from intersections (see @dropTransparentClasses ).
629
629
*
630
630
* Don't do these widenings if `bound` is a subtype of `scala.Singleton`.
631
631
* Also, if the result of these widenings is a TypeRef to a module class,
@@ -659,7 +659,7 @@ trait ConstraintHandling {
659
659
if (widenedFromUnion ne widenedFromSingle) && isTransparent(widenedFromUnion) then
660
660
widenedFromSingle
661
661
else
662
- dropTransparentTraits (widenedFromUnion, bound)
662
+ dropTransparentClasses (widenedFromUnion, bound)
663
663
widenIrreducible(widened)
664
664
665
665
wideInst match
0 commit comments