Mercurial > projects > ldc
annotate tests/mini/interface5.d @ 528:3197ffdc2811
Fixed problem with parameterized intrinsics taking bools.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 20 Aug 2008 19:01:56 +0200 |
parents | 1bb99290e03a |
children | dde9dbae052a |
rev | line source |
---|---|
114 | 1 module interface5; |
2 | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
114
diff
changeset
|
3 extern(C) int printf(char*,...); |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
114
diff
changeset
|
4 |
114 | 5 interface I |
6 { | |
7 void func(); | |
8 } | |
9 | |
10 class C : I | |
11 { | |
12 int i; | |
13 void func() | |
14 { | |
15 printf("C\n"); | |
16 i++; | |
17 } | |
18 } | |
19 | |
20 void main() | |
21 { | |
22 C c = new C; | |
23 c.func(); | |
24 { | |
25 I i = c; | |
26 c.func(); | |
27 | |
28 C c2 = cast(C)i; | |
29 c2.func(); | |
30 | |
31 c.func(); | |
32 assert(c.i == 4); | |
33 } | |
34 } |