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 54d153d
Browse filesBrowse the repository at this point in the historyBrowse files
Compare bigint patterns and constants by their values
Why:
A bigint payload pattern equal to a bigint literal case, such as
`BI(2n)` beside `@as(2n) Two`, got no warning although it can never
match, and a match on a bigint constant was never folded: both treated
bigints as never comparable, from before literals were compared by their
normalized values.
Bigint pattern constants and bigint constants have their literal, so the
shadowed-payload warnings and constant folding compare them as `===` does:
`02n` is `2n`.
Diagnostic added (shadowed bigint payload):
Example:
@unboxed type t = | @as(2n) Two | BI(bigint) | S(string)
let f = (v: t) =>
switch v {
| BI(02n) => "dead"
| BI(_) => "bigint"
| _ => "other"
}
Before (diagnostic): none
After (diagnostic):
this match case is unused.
2n is the runtime value of constructor Two, so it is always matched as Two, never as BI.
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