Mercurial > projects > ldc
comparison tests/mini/k.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | tangotests/k.d@44a95ac7368a |
children |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
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 } |