Skip to content

Commit

Permalink
fix ternary test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek committed Nov 20, 2024
1 parent 20c099e commit 28f9ebd
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,17 @@ else:
assert(tern == f.simplify)
}
case whoKnows =>
assert(tern == Code.Ternary(t.simplify, whoKnows, f.simplify))
if (tern == whoKnows) {
(t.simplify, f.simplify) match {
case (Code.Const.One | Code.Const.True, Code.Const.False | Code.Const.Zero) =>
()
case tf =>
fail(s"$tern == $whoKnows but (t,f) = $tf")
}
}
else {
assert(tern == Code.Ternary(t.simplify, whoKnows, f.simplify))
}
}
}
}
Expand Down

0 comments on commit 28f9ebd

Please sign in to comment.