From 79176c7ac58900c95db5db9cf75978e91e9a453c Mon Sep 17 00:00:00 2001 From: Alasdair Date: Sat, 18 Aug 2018 00:47:10 +0100 Subject: Correctly specialise type annotation in polymorphic functions --- test/c/special_annot.expect | 1 + test/c/special_annot.sail | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/c/special_annot.expect create mode 100644 test/c/special_annot.sail (limited to 'test') diff --git a/test/c/special_annot.expect b/test/c/special_annot.expect new file mode 100644 index 00000000..ee8a39c3 --- /dev/null +++ b/test/c/special_annot.expect @@ -0,0 +1 @@ +string diff --git a/test/c/special_annot.sail b/test/c/special_annot.sail new file mode 100644 index 00000000..ca2f5f4c --- /dev/null +++ b/test/c/special_annot.sail @@ -0,0 +1,19 @@ + +union option ('a : Type) = { + None : unit, + Some : 'a +} + +val test : forall ('a : Type). 'a -> option('a) + +function test(x) = + let y : 'a = x in Some(y) + +val "print_endline" : string -> unit + +val main : unit -> unit + +function main() = { + let Some(y) = test("string"); + print_endline(y) +} \ No newline at end of file -- cgit v1.2.3