Mercurial > projects > ldc
annotate test/interface6.d @ 270:d9d5d59873d8 trunk
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
Branch statements now emit a new block after it.
Fixed the _adSort runtime function had a bad signature.
Added a missing dot prefix on compiler generated string tables for string switch.
Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author | lindquist |
---|---|
date | Mon, 16 Jun 2008 16:01:19 +0200 |
parents | 44a95ac7368a |
children |
rev | line source |
---|---|
114 | 1 module interface6; |
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 Ifunc(); | |
8 } | |
9 | |
10 interface J | |
11 { | |
12 void Jfunc(); | |
13 } | |
14 | |
15 class C : I,J | |
16 { | |
17 int i; | |
18 int j; | |
19 void Ifunc() | |
20 { | |
21 i++; | |
22 } | |
23 void Jfunc() | |
24 { | |
25 j++; | |
26 } | |
27 } | |
28 | |
29 void main() | |
30 { | |
31 C c = new C; | |
32 c.Ifunc(); | |
33 c.Jfunc(); | |
34 I i = c; | |
35 i.Ifunc(); | |
36 J j = c; | |
37 j.Jfunc(); | |
38 C c2 = cast(C)i; | |
39 c2.Ifunc(); | |
40 c2.Jfunc(); | |
41 C c3 = cast(C)j; | |
42 c3.Ifunc(); | |
43 c3.Jfunc(); | |
44 assert(c.i == 4); | |
45 assert(c.j == 4); | |
46 } |