Files
ldc/test/interface5.d
Tomas Lindquist Olsen 4505b9b006 [svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
In particular, assertions has been fixed to include file/line info, and much more!
2008-01-14 05:11:54 +01:00

35 lines
364 B
D

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;
c.func();
C c2 = cast(C)i;
c2.func();
c.func();
assert(c.i == 4);
}
}