mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-02 10:33:13 +01:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
35
tests/mini/interface4.d
Normal file
35
tests/mini/interface4.d
Normal file
@@ -0,0 +1,35 @@
|
||||
module interface4;
|
||||
|
||||
extern(C) int printf(char*,...);
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user