From 3565fb66df2ce0aac8efdf3663eb9a729d7cd03c Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 9 Aug 2018 16:57:13 +0100 Subject: Fix bugs involving multi-argument variant type constructors --- test/c/poly_pair.expect | 1 + test/c/poly_pair.sail | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/c/poly_pair.expect create mode 100644 test/c/poly_pair.sail (limited to 'test') diff --git a/test/c/poly_pair.expect b/test/c/poly_pair.expect new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/test/c/poly_pair.expect @@ -0,0 +1 @@ +1 diff --git a/test/c/poly_pair.sail b/test/c/poly_pair.sail new file mode 100644 index 00000000..6d0bdaad --- /dev/null +++ b/test/c/poly_pair.sail @@ -0,0 +1,20 @@ +default Order dec + +val print = "print_endline" : string -> unit + +val "eq_int" : (int, int) -> bool + +union test ('a : Type) ('b : Type) = { + Ctor1 : ('a, 'b), + Ctor2 : int +} + +val main : unit -> unit + +function main() = { + let x = Ctor1(3, 2); + match x { + Ctor1(y, z) if eq_int(y, 3) => print("1"), + _ => print("2") + }; +} \ No newline at end of file -- cgit v1.2.3