view tests/mini/interface5.d @ 1630:44b145be2ef5

Merge dmd 1.056.
author Robert Clipsham <robert@octarineparrot.com>
date Sat, 06 Feb 2010 15:53:52 +0000
parents dde9dbae052a
children
line wrap: on
line source

module interface5;

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

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;
        i.func();

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

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