-
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
A potential bug was mentioned on Discord earlier this week so I went ahead and confirmed the bug actually does occur, and thought it was a good idea to record here so it's not forgotten later.
The following code (provided by Stachu, with some minimal edits applied after) demonstrates the bug:
// <test>
// does _ wildcard pattern match a DU that has a tuple?
// result: matches string "not expected"
// even though "expected" case is meant to match because of wildcard
type DU = | A | B of Bool * Bool
(match DU.B (true, false) with
| A -> "nope"
| B _ -> "expected"
| B (_, _) -> "not expected") = "expected"
// </test>I have a permalink on my fork which adds an Expecto test to run/confirm the bug, but it's likely easier to copy-paste the buggy code into one's own local copy.
Metadata
Metadata
Assignees
Labels
No labels