mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
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 !!!
31 lines
377 B
D
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);}
|
|
}
|