From df8429663a598d75853195d6552dda0e279e711f Mon Sep 17 00:00:00 2001 From: Alasdair Date: Tue, 23 Jun 2020 22:46:19 +0100 Subject: Fix bug with duplicate enum identifiers in patterns --- test/c/enum_tup_match.expect | 1 + test/c/enum_tup_match.sail | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/c/enum_tup_match.expect create mode 100644 test/c/enum_tup_match.sail (limited to 'test') 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 + +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") +} -- cgit v1.2.3