Simplify a boolean other than one to the other boolean
Why
typeof x === "boolean" && x !== b was simplified to the constant !b, not to x === !b as its doc comment says. A match on a bool payload beside a bool literal case produces this conjunction, so it never or always took the payload arm (#9035).
modifiedJS bool payload beside a bool literal
@unboxed type t = | @as(true) LitTrue | AnyBool(bool) | AnyInt(int)let f = (v: t) => switch v { | AnyBool(_) => "bool" | _ => "other" }
js
Before
After
function f(v) {function f(v) { return "other"; if (v !== false) { return "other"; } else { return "bool"; }}}
Fixes #9035