comparison run/mini/nested16.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 mini.nested16;
2
3 void main()
4 {
5 int idx = 123;
6 int func(int* idp)
7 {
8 void foo()
9 {
10 void bar(int* idp)
11 {
12 auto c = new class
13 {
14 void mem()
15 {
16 scope(exit) ++*idp;
17 }
18 };
19 auto dg = () {
20 c.mem();
21 };
22 dg();
23 }
24 bar(idp);
25 ++*idp;
26 }
27 foo();
28 return ++*idp;
29 }
30 assert(func(&idx) == 126);
31 }