comparison run/mini/interface2.d @ 1628:c6ef09dfba4d

add mini test set from ldc project
author Moritz Warning <moritzwarning@web.de>
date Mon, 10 Jan 2011 19:47:18 +0100
parents
children
comparison
equal deleted inserted replaced
1627:e1b954780837 1628:c6ef09dfba4d
1 module interface2;
2
3 extern(C) int printf(char*,...);
4
5 interface A
6 {
7 void a();
8 }
9
10 interface B
11 {
12 void b();
13 }
14
15 class C : A,B
16 {
17 int i = 0;
18 override void a()
19 {
20 printf("hello from C.a\n");
21 }
22 override void b()
23 {
24 printf("hello from C.b\n");
25 }
26 }
27
28 void main()
29 {
30 scope c = new C;
31 {c.a();
32 c.b();}
33 {A a = c;
34 a.a();}
35 {B b = c;
36 b.b();}
37 }