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 8cb50ef
Browse filesBrowse the repository at this point in the historyBrowse files
Keep outer literal cases when looking into nested untagged payloads
Why:
Below a second untagged constructor, an or-pattern was checked against
the inner variant's literal cases only, although the outer variant's
literal cases are tested first on the same value.
The literal cases that take precedence are carried down through untagged
payloads, outermost first, each with the payload constructor it shadows.
Diagnostic added (an or-pattern below a nested untagged payload):
Example:
@unboxed type inner = | @as("x") X | N(int) | S(string)
@unboxed type outer = | @as(1) One | W(inner)
let f = v => switch v { | One => "one" | W(N(1 | 2)) => "small" | W(_) => "other" }
Before (diagnostic): none
After (diagnostic):
Warning number 12
this sub-pattern is unused.
1 is the runtime value of constructor One, so it is always matched as One, never as W.
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