diff test/structs4.d @ 24:25bb577878e8 trunk

[svn r28] * Fixed accessing aggregate fields. it was still not quite right. hopefully is now :)
author lindquist
date Thu, 04 Oct 2007 10:13:21 +0200
parents
children b706170e24a9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/structs4.d	Thu Oct 04 10:13:21 2007 +0200
@@ -0,0 +1,26 @@
+module structs4;
+
+struct S{
+    int a;
+    T t;
+}
+
+struct T{
+    int b;
+    U u;
+}
+
+struct U{
+    int c;
+}
+
+void main()
+{
+    S s;
+    s.a = 3;
+    s.t = T.init;
+    s.t.b = 4;
+    s.t.u = U.init;
+    s.t.u.c = 5;
+    {assert(s.t.u.c == 5);}
+}