view test/interface3.d @ 128:e5fe8521bbfa trunk

[svn r132] Added some tests. some will fail at the moment.
author lindquist
date Fri, 30 Nov 2007 17:12:08 +0100
parents 27b9f749d9fe
children 44a95ac7368a
line wrap: on
line source

module interface3;

interface I
{
    void func();
}

class C : I
{
    int i = 42;
    override void func()
    {
        printf("hello %d\n", i);
        i++;
    }
}

void main()
{
    scope c = new C;
    {c.func();}
    {
        I i = c;
        {i.func();}
    }
    {printf("final %d\n", c.i);}
    {assert(c.i == 44);}
}