@@ -343,11 +343,11 @@ class Simplify extends MiniPhaseTransform with IdentityDenotTransformer {
343
343
case If (cond1, If (cond2, thenp2, elsep2), elsep1) if isSimilar(elsep1, elsep2) =>
344
344
If (cond1.select(defn.Boolean_&& ).appliedTo(cond2), thenp2, elsep1)
345
345
case If (cond1, If (cond2, thenp2, elsep2), elsep1) if isSimilar(elsep1, thenp2) =>
346
- If (cond1.select(defn.Boolean_! ).select(defn.Boolean_|| ).appliedTo(cond2), elsep1, elsep2)
346
+ If (cond1.select(defn.Boolean_! ).ensureApplied. select(defn.Boolean_|| ).appliedTo(cond2), elsep1, elsep2)
347
347
case If (cond1, thenp1, If (cond2, thenp2, elsep2)) if isSimilar(thenp1, thenp2) =>
348
348
If (cond1.select(defn.Boolean_|| ).appliedTo(cond2), thenp1, elsep2)
349
349
case If (cond1, thenp1, If (cond2, thenp2, elsep2)) if isSimilar(thenp1, elsep2) =>
350
- If (cond1.select(defn.Boolean_|| ).appliedTo(cond2.select(defn.Boolean_! )), thenp1, thenp2)
350
+ If (cond1.select(defn.Boolean_|| ).appliedTo(cond2.select(defn.Boolean_! ).ensureApplied ), thenp1, thenp2)
351
351
case If (t : Literal , thenp, elsep) =>
352
352
if (t.const.booleanValue) thenp
353
353
else elsep
@@ -368,7 +368,7 @@ class Simplify extends MiniPhaseTransform with IdentityDenotTransformer {
368
368
// //if (thenp.const.booleanValue)
369
369
// cond.select(defn.Boolean_||).appliedTo(elsep)
370
370
// //else // thenp is false, this tree is bigger then the original
371
- // // cond.select(defn.Boolean_!).select(defn.Boolean_&&).appliedTo(elsep)
371
+ // // cond.select(defn.Boolean_!).ensureApplied. select(defn.Boolean_&&).appliedTo(elsep)
372
372
// case ift @ If(cond, thenp, elsep :Literal) if ift.tpe.derivesFrom(defn.BooleanClass) && !elsep.const.booleanValue =>
373
373
// cond.select(defn.Boolean_&&).appliedTo(elsep)
374
374
// // the other case ins't handled intentionally. See previous case for explanation
0 commit comments