Mercurial > projects > dstress
comparison run/mini/k.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 interface Inter | |
2 { | |
3 int func(); | |
4 } | |
5 | |
6 extern(C) int printf(char*, ...); | |
7 | |
8 class InterClass : Inter | |
9 { | |
10 int func() | |
11 { | |
12 return printf("InterClass.func()\n"); | |
13 } | |
14 } | |
15 | |
16 alias int delegate() dg_t; | |
17 | |
18 void main() | |
19 { | |
20 scope c = new InterClass; | |
21 | |
22 { | |
23 Inter i = cast(Inter)c; | |
24 { | |
25 dg_t dg = &i.func; | |
26 { | |
27 int j = dg(); | |
28 } | |
29 } | |
30 } | |
31 } |