Files
ldc/tests/mini/interface3.d
Tomas Lindquist Olsen f46f865375 Removed KDevelop3 project files, CMake can generate them just fine!
Fixed function literals in static initializers.
Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE.
Changed errors to go to stderr instead of stdout.
Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
2008-11-29 21:25:43 +01:00

31 lines
377 B
D

module interface3;
extern(C) int printf(char*,...);
interface I
{
void func();
}
class C : I
{
int i = 42;
override void func()
{
printf("hello %d from %p\n", i, this);
i++;
}
}
void main()
{
auto c = new C;
{c.func();}
{
I i = c;
{i.func();}
}
{printf("final %d\n", c.i);}
{assert(c.i == 44);}
}