view test/innerclass1.d @ 273:25fa34e899e9 trunk

[svn r294] Fixed some more of the old tests.
author lindquist
date Wed, 18 Jun 2008 23:29:14 +0200
parents d9d5d59873d8
children
line wrap: on
line source

module innerclass1;
extern(C) int printf(char*, ...);

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");
}