836
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 module dstress.run.c.class_20_H;
|
|
6
|
|
7 interface A{
|
|
8 int foo();
|
|
9 int bar();
|
|
10 }
|
|
11
|
|
12 interface B{
|
|
13 int dummy();
|
|
14 int bar();
|
|
15 }
|
|
16
|
|
17
|
|
18 class C(T) : T, B{
|
|
19 int foo(){
|
|
20 return 0;
|
|
21 }
|
|
22
|
|
23 int dummy(){
|
|
24 return 2;
|
|
25 }
|
1090
|
26
|
836
|
27 int bar(){
|
|
28 return 1;
|
|
29 }
|
|
30 }
|
|
31
|
|
32 int main(){
|
|
33 auto c = new C!(A)();
|
|
34
|
|
35 if(c.foo() != 0){
|
|
36 assert(0);
|
|
37 }
|
|
38
|
|
39 if(c.bar() != 1){
|
|
40 assert(0);
|
|
41 }
|
|
42
|
|
43 if(c.dummy() != 2){
|
|
44 assert(0);
|
|
45 }
|
|
46
|
|
47 A a = c;
|
|
48
|
|
49 if(a.foo() != 0){
|
|
50 assert(0);
|
|
51 }
|
|
52
|
|
53 if(a.bar() != 1){
|
|
54 assert(0);
|
|
55 }
|
|
56
|
|
57 B b = c;
|
|
58
|
|
59 if(b.bar() != 1){
|
|
60 assert(0);
|
|
61 }
|
|
62
|
|
63 if(c.dummy() != 2){
|
|
64 assert(0);
|
|
65 }
|
|
66
|
|
67 return 0;
|
|
68 }
|