diff options
| author | Alasdair Armstrong | 2018-08-09 18:51:36 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-08-09 18:53:11 +0100 |
| commit | 01fd68577abfa98a901b220a9928b397047e9fd4 (patch) | |
| tree | eefc8548638858210c54ca95a891840d70b5b146 /test | |
| parent | d552f97f9fc8bc8fb7c521c1ea4d8a82ca9357d4 (diff) | |
Fix a bug by ensuring that monomorphic variant constructors do not get lifted types
Add a test case for nested variant constructors
Diffstat (limited to 'test')
| -rw-r--r-- | test/c/poly_union.expect | 1 | ||||
| -rw-r--r-- | test/c/poly_union.sail | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/c/poly_union.expect b/test/c/poly_union.expect new file mode 100644 index 00000000..f6b3d557 --- /dev/null +++ b/test/c/poly_union.expect @@ -0,0 +1 @@ +HCF diff --git a/test/c/poly_union.sail b/test/c/poly_union.sail new file mode 100644 index 00000000..02a80e17 --- /dev/null +++ b/test/c/poly_union.sail @@ -0,0 +1,27 @@ +default Order dec + +val print = "print_endline" : string -> unit + +union ast = { + HCF : unit +} + +union option ('a : Type) = { + Some : 'a, + None : unit +} + +val decode : unit -> option(ast) + +function decode() = Some(HCF()) + +val main : unit -> unit + +function main() = { + let instr = decode(); + match instr { + Some(HCF()) => print("HCF"), + Some(_) => print("Some(_)"), + None() => print("None") + } +}
\ No newline at end of file |
