view test/interface5.d @ 124:a939ec89fc72 trunk

[svn r128] function local typedefs were not working
author lindquist
date Wed, 28 Nov 2007 03:34:37 +0100
parents 5880c12dba83
children 44a95ac7368a
line wrap: on
line source

module interface5;

interface I
{
    void func();
}

class C : I
{
    int i;
    void func()
    {
        printf("C\n");
        i++;
    }
}

void main()
{
    C c = new C;
    c.func();
    {
        I i = c;
        c.func();

        C c2 = cast(C)i;
        c2.func();

        c.func();
        assert(c.i == 4);
    }
}