Files
ldc/test/interface4.d
Tomas Lindquist Olsen b43f5729b0 [svn r117] Initial working implementation of interfaces.
Groundwork for all the different types of class/interface casts laid out.
2007-11-24 06:33:00 +01:00

34 lines
370 B
D

module interface4;
interface I
{
void func();
}
interface I2
{
void func();
}
class C : I,I2
{
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();
I2 i2 = c;
i2.func();
printf("final %d\n", c.i);
assert(c.i == 45);
}