ref: f16eddc8b5b4c20a4aef509d3b9f69ef83b49b4c
parent: fbbdeabda88a0262e59d68fcf5227c165d673afe
author: Ori Bernstein <[email protected]>
date: Sat Jun 8 11:02:26 EDT 2013
Add test for live struct literals.
--- /dev/null
+++ b/test/livestructlit.myr
@@ -1,0 +1,20 @@
+use std
+
+/* checks that we can create struct literals with named initializers.
+ exits with 42. */
+type t = struct
+ a : int
+ b : byte
+ c : byte[:]
+;;
+
+const main = {
+ var v : t
+
+ v = [.a=foo(), .b=42, .c="foo"]
+ -> v.a
+}
+
+const foo = {
+ -> 21
+}
--- a/test/tests
+++ b/test/tests
@@ -73,6 +73,7 @@
B arraylit-ni E 2
# B arraylit E 3 ## BUGGERED
B structlit E 42
+B livestructlit E 21
B tuple E 42
B slgrow E 42
B tyrec E 42