Semantic Diff

#9036 Fix a bool payload beside a bool literal in an incomplete match

1 commit

d48d577bf67854c0023aa07a2a5a219d015d1f9f..pr-9036

717d266fa · cknitt + Claude · Oct 25, 2026, 06:02 UTC

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