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