Mercurial > projects > ldc
comparison tangotests/j.d @ 133:44a95ac7368a trunk
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
In particular, assertions has been fixed to include file/line info, and much more!
author | lindquist |
---|---|
date | Mon, 14 Jan 2008 05:11:54 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
132:1700239cab2e | 133:44a95ac7368a |
---|---|
1 module j; | |
2 | |
3 interface Inter1 | |
4 { | |
5 int func1(); | |
6 } | |
7 | |
8 interface Inter2 | |
9 { | |
10 int func2(); | |
11 } | |
12 | |
13 class C12 : Inter1, Inter2 | |
14 { | |
15 int func1() | |
16 { | |
17 return 1; | |
18 } | |
19 int func2() | |
20 { | |
21 return 2; | |
22 } | |
23 } | |
24 | |
25 void func(Object c) | |
26 { | |
27 auto i1 = cast(Inter1)c; | |
28 assert(i1.func1() == 1); | |
29 auto i2 = cast(Inter2)c; | |
30 assert(i2.func2() == 2); | |
31 auto j1 = cast(Inter1)i2; | |
32 assert(j1.func1() == 1); | |
33 auto j2 = cast(Inter2)i1; | |
34 assert(j2.func2() == 2); | |
35 } | |
36 | |
37 void main() | |
38 { | |
39 scope c = new C12; | |
40 func(c); | |
41 printf("OK\n"); | |
42 } | |
43 | |
44 extern(C) int printf(char*,...); |