You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f12e8e7
Browse filesBrowse the repository at this point in the historyBrowse files
Cover payloads by a bool literal only when they are bools
Why:
The exhaustiveness check let a bool literal case cover the equal value
of any boolean-kind payload, including a `@typeOf("boolean")` type that
is not `bool`. The synthesized `true` pattern did not fit that type, so
a match missing the payload was taken as complete.
Only a payload whose type expands to `bool` gets the synthesized pattern.
Diagnostic added (a @typeof("boolean") payload):
Example:
@typeof("boolean") type jsBool
@unboxed type t = | @as(true) Yes | Value(jsBool)
let f = (v: t) => switch v { | Yes => 1 }
Before (diagnostic): none
After (diagnostic):
Warning number 8
You forgot to handle a possible case here, for example:
| Value(_)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMkrYaktctdKc4M41WF36t
Signed-off-by: Christoph Knittel <ck@cca.io>
0 commit comments