diff options
| author | Alasdair | 2020-06-23 22:46:19 +0100 |
|---|---|---|
| committer | Alasdair | 2020-06-23 22:49:31 +0100 |
| commit | df8429663a598d75853195d6552dda0e279e711f (patch) | |
| tree | 092b00144088fbbdf1cd104e71ca55197fea31f4 /test/c | |
| parent | a76ee971789a074c7b262d583e14a703a143a372 (diff) | |
Fix bug with duplicate enum identifiers in patterns
Diffstat (limited to 'test/c')
| -rw-r--r-- | test/c/enum_tup_match.expect | 1 | ||||
| -rw-r--r-- | test/c/enum_tup_match.sail | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/c/enum_tup_match.expect b/test/c/enum_tup_match.expect new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/test/c/enum_tup_match.expect @@ -0,0 +1 @@ +ok diff --git a/test/c/enum_tup_match.sail b/test/c/enum_tup_match.sail new file mode 100644 index 00000000..852cebc1 --- /dev/null +++ b/test/c/enum_tup_match.sail @@ -0,0 +1,24 @@ +default Order dec + +$include <prelude.sail> + +val "print_endline" : string -> unit + +enum foo = { + Bar, + Baz +} + +val test : (foo, foo) -> bool + +function test(x, y) = + match (x, y) { + (Baz, Baz) => false, + (Bar, Bar) => true, + (_, _) => false + } + +function main() : unit -> unit = { + assert(test(Bar, Bar)); + print_endline("ok") +} |
