Mercurial > projects > ldc
comparison test/bug24.d @ 50:6fcc08a4d406 trunk
[svn r54] Added support for nested delegates referencing parent's stack variables.
Replaced tester.sh with a version written in D.
A few bugfixes.
author | lindquist |
---|---|
date | Mon, 22 Oct 2007 15:40:56 +0200 |
parents | |
children | d9d5d59873d8 |
comparison
equal
deleted
inserted
replaced
49:e5c4bece7fa1 | 50:6fcc08a4d406 |
---|---|
1 module bug24; | |
2 | |
3 struct S | |
4 { | |
5 long l; | |
6 float f; | |
7 } | |
8 | |
9 void main() | |
10 { | |
11 S s = S(3L,2f); | |
12 delegate { | |
13 S t = S(4L, 1f); | |
14 delegate { | |
15 s.l += t.l; | |
16 s.f += t.f; | |
17 }(); | |
18 }(); | |
19 printf("%lu %f\n", s.l, s.f); | |
20 assert(s.l == 7 && s.f == 3); | |
21 } |