diff test/innerclass1.d @ 123:7f9a0a58394b trunk

[svn r127] Updated the lphobos build scripts a little. Created a new rebuild profile. Removed some potentially very long logging lines. Added support for inner classes.
author lindquist
date Wed, 28 Nov 2007 03:01:51 +0100
parents
children d9d5d59873d8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/innerclass1.d	Wed Nov 28 03:01:51 2007 +0100
@@ -0,0 +1,29 @@
+module innerclass1;
+
+class Outer
+{
+    int i;
+    class Inner
+    {
+        int func()
+        {
+            return i;
+        }
+    }
+}
+
+void main()
+{
+    Outer o = new Outer;
+    {
+        o.i = 42;
+        {
+            auto i = o.new Inner;
+            {
+                int x = i.func();
+                assert(x == 42);
+            }
+        }
+    }
+    printf("SUCCESS\n");
+}