summaryrefslogtreecommitdiff
path: root/test/neststruct.myr
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2012-08-15 16:04:40 -0400
committerOri Bernstein <orib@google.com>2012-08-15 16:04:40 -0400
commit41ce4dfc1dd66f229d63305bf76881afaa137df1 (patch)
tree5d6c1fe1b26b6cb9a2059a392cdccc29af72cce4 /test/neststruct.myr
parentb1e6a04201002d4dc9dbd2d5ee410d30ec5a3cac (diff)
downloadmc-41ce4dfc1dd66f229d63305bf76881afaa137df1.tar.gz
Add another broken test for nested structs.
Diffstat (limited to 'test/neststruct.myr')
-rw-r--r--test/neststruct.myr19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/neststruct.myr b/test/neststruct.myr
new file mode 100644
index 0000000..1c5aefe
--- /dev/null
+++ b/test/neststruct.myr
@@ -0,0 +1,19 @@
+type s1 = struct
+ x : s2
+;;
+
+type s2 = struct
+ a : int
+ b : int
+;;
+
+const main = {
+ var s1 : s1
+ var s2 : s2
+
+ s1.x.a = 1
+ s1.x.b = 2
+ s2 = s1.x
+
+ -> s2.a + s2.b
+}