shithub: mc

Download patch

ref: bfa86d22fdc7b22fa4bc2819d4aa928acfac5168
parent: c246138e19efb1949e562717653adf9e41067fa5
author: Ori Bernstein <[email protected]>
date: Fri Jun 29 16:11:02 EDT 2012

Add test for unions with args

--- /dev/null
+++ b/test/matchargunion.myr
@@ -1,0 +1,26 @@
+type u = union
+	`Int int
+	`Chr char
+	`Nil
+;;
+
+const main = {
+	var v
+
+	v = `Int 123
+	match v
+	`Int 127:
+		-> 42
+		;;
+	`Int 123:
+		-> 69
+		;;
+	`Chr 'a':
+		-> 4
+		;;
+	`Nil:
+		-> 6
+		;;
+	;;
+}
+
--- a/test/tests
+++ b/test/tests
@@ -42,6 +42,7 @@
 B mkunion	E	0
 B matchint	E	84
 B matchunion	E	84
+B matchargunion	E	69
 F declmismatch
 F infermismatch
 F flow