Mercurial > projects > ldc
comparison tests/mini/interface3.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | test/interface3.d@44a95ac7368a |
children | 340acf1535d0 |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module interface3; | |
2 | |
3 extern(C) int printf(char*,...); | |
4 | |
5 interface I | |
6 { | |
7 void func(); | |
8 } | |
9 | |
10 class C : I | |
11 { | |
12 int i = 42; | |
13 override void func() | |
14 { | |
15 printf("hello %d\n", i); | |
16 i++; | |
17 } | |
18 } | |
19 | |
20 void main() | |
21 { | |
22 scope c = new C; | |
23 {c.func();} | |
24 { | |
25 I i = c; | |
26 {i.func();} | |
27 } | |
28 {printf("final %d\n", c.i);} | |
29 {assert(c.i == 44);} | |
30 } |