@@ -1983,8 +1983,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
19831983 /** Merge `t1` into `tp2` if t1 is a subtype of some &-summand of tp2.
19841984 */
19851985 private def mergeIfSub (tp1 : Type , tp2 : Type ): Type =
1986- if (isSubTypeWhenFrozen(tp1, tp2))
1987- if (isSubTypeWhenFrozen(tp2, tp1)) tp2 else tp1 // keep existing type if possible
1986+ if (isSubTypeWhenFrozen(tp1, tp2)) tp1
19881987 else tp2 match {
19891988 case tp2 @ AndType (tp21, tp22) =>
19901989 val lower1 = mergeIfSub(tp1, tp21)
@@ -2004,8 +2003,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
20042003 * @param canConstrain If true, new constraints might be added to make the merge possible.
20052004 */
20062005 private def mergeIfSuper (tp1 : Type , tp2 : Type , canConstrain : Boolean ): Type =
2007- if (isSubType(tp2, tp1, whenFrozen = ! canConstrain))
2008- if (isSubType(tp1, tp2, whenFrozen = ! canConstrain)) tp2 else tp1 // keep existing type if possible
2006+ if (isSubType(tp2, tp1, whenFrozen = ! canConstrain)) tp1
20092007 else tp2 match {
20102008 case tp2 @ OrType (tp21, tp22) =>
20112009 val higher1 = mergeIfSuper(tp1, tp21, canConstrain)
0 commit comments