summaryrefslogtreecommitdiff
path: root/test/empty-struct.myr
diff options
context:
space:
mode:
Diffstat (limited to 'test/empty-struct.myr')
-rw-r--r--test/empty-struct.myr26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/empty-struct.myr b/test/empty-struct.myr
new file mode 100644
index 0000000..a3ec75a
--- /dev/null
+++ b/test/empty-struct.myr
@@ -0,0 +1,26 @@
+use std
+
+type foo = struct
+;;
+
+type bar = struct
+ baz : foo[:]
+ quux : foo[0][:]
+;;
+
+
+const main = {
+ var a : foo
+ var z : foo[0]
+ var b : bar = [.baz = [a, a][:], .quux = [z, z, z][:]]
+ var c : int = 0
+ for f in b.baz
+ c += 3
+ ;;
+
+ for f in b.quux
+ c += 5
+ ;;
+
+ std.exit(c)
+}