diff options
| author | Alasdair Armstrong | 2018-08-09 16:57:13 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-08-09 16:57:13 +0100 |
| commit | 3565fb66df2ce0aac8efdf3663eb9a729d7cd03c (patch) | |
| tree | c950d89745ed27b105c9df9d253e4a69e57c03ef /test | |
| parent | 31b90f760bd0bb687ad4e7c645e4dc985c8a11ca (diff) | |
Fix bugs involving multi-argument variant type constructors
Diffstat (limited to 'test')
| -rw-r--r-- | test/c/poly_pair.expect | 1 | ||||
| -rw-r--r-- | test/c/poly_pair.sail | 20 |
2 files changed, 21 insertions, 0 deletions
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 |
