@@ -654,17 +654,17 @@ trait ConstraintHandling {
654
654
if tpw ne tp then
655
655
if tpw.isTransparent() then
656
656
// Now also widen singletons of soft unions. Before these were skipped
657
- // since we widenUnion on soft unions is independent of whether singletons
657
+ // since widenUnion on soft unions is independent of whether singletons
658
658
// are widened or not. This avoids an expensive subtype check in widenSingle,
659
- // see 19907_ *.scala for test cases.
660
- tp.widenSingletons( )
659
+ // see i19907_ *.scala for test cases.
660
+ widenSingle(tp, skipSoftUnions = false )
661
661
else if tpw <:< bound then tpw
662
662
else tp
663
663
else tp
664
664
else tp.hardenUnions
665
665
666
- def widenSingle (tp : Type ) =
667
- val tpw = tp.widenSingletons(skipSoftUnions = widenUnions )
666
+ def widenSingle (tp : Type , skipSoftUnions : Boolean ) =
667
+ val tpw = tp.widenSingletons(skipSoftUnions)
668
668
if (tpw ne tp) && (tpw <:< bound) then tpw else tp
669
669
670
670
def isSingleton (tp : Type ): Boolean = tp match
@@ -674,7 +674,7 @@ trait ConstraintHandling {
674
674
val wideInst =
675
675
if isSingleton(bound) then inst
676
676
else
677
- val widenedFromSingle = widenSingle(inst)
677
+ val widenedFromSingle = widenSingle(inst, skipSoftUnions = widenUnions )
678
678
val widenedFromUnion = widenOr(widenedFromSingle)
679
679
val widened = dropTransparentTraits(widenedFromUnion, bound)
680
680
widenIrreducible(widened)
0 commit comments