summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-01-20 00:32:35 -0800
committerOri Bernstein <ori@eigenstate.org>2015-01-20 00:32:35 -0800
commit61a9e807de75f67fd5467aa671b00935d202f0e3 (patch)
treec4cc093fdebe225c9542086dcfba06c41d049087 /test
parent7f27f03b1887e599d6e9be6644895e8ab2bd5940 (diff)
downloadmc-61a9e807de75f67fd5467aa671b00935d202f0e3.tar.gz
Add support for constant union initializers.
Oops, that was broked.
Diffstat (limited to 'test')
-rw-r--r--test/tests1
-rw-r--r--test/uconinit.myr21
2 files changed, 22 insertions, 0 deletions
diff --git a/test/tests b/test/tests
index fc0da00..aadc60e 100644
--- a/test/tests
+++ b/test/tests
@@ -83,6 +83,7 @@ B traitimpl P 246,44,meee
# B compoundimpl P intptr,charptr BUGGERED
B nestucon P asdf
B mkunion E 0
+B uconinit P 'A B C 123'
B genericcall E 42
B generictype E 0
B genericret E 42
diff --git a/test/uconinit.myr b/test/uconinit.myr
new file mode 100644
index 0000000..824879b
--- /dev/null
+++ b/test/uconinit.myr
@@ -0,0 +1,21 @@
+use std
+
+type u = union
+ `A
+ `B
+ `C int
+;;
+
+const a = [`A, `B, `C 123]
+
+const main = {
+ for v in a
+ match v
+ | `A: std.put("A ")
+ | `B: std.put("B ")
+ | `C x: std.put("C %i\n", x)
+ ;;
+ ;;
+ std.put("\n")
+}
+