shithub: mc

Download patch

ref: 84704c066eabc23c45f637ae7cb2c89a3204a12a
parent: 9f536f372f8d048d1d5ac1baf5858690731cfb52
author: Ori Bernstein <[email protected]>
date: Wed Sep 18 14:24:32 EDT 2013

Add a new test for matching over generics.

    Currently fails due to a lack of deep unification in post-union
    matching.

--- /dev/null
+++ b/test/genericmatch.myr
@@ -1,0 +1,13 @@
+use std
+
+type t(@a) = union
+	`Foo @a
+	`Bar
+;;
+
+const main = {
+	match `Foo 123
+	`Foo a:	-> 0xf;;
+	`Bar:	-> 0x0;;
+	;;
+}
--- a/test/tests
+++ b/test/tests
@@ -62,6 +62,7 @@
 B genericcall	E	42
 B generictype	E	0
 B genericret	E	42
+B genericmatch	E	15
 B genericrec	E	0
 B sizeof	E	4
 B gsizeof	E	5