Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug24.d Mon Oct 22 15:40:56 2007 +0200 @@ -0,0 +1,21 @@ +module bug24; + +struct S +{ + long l; + float f; +} + +void main() +{ + S s = S(3L,2f); + delegate { + S t = S(4L, 1f); + delegate { + s.l += t.l; + s.f += t.f; + }(); + }(); + printf("%lu %f\n", s.l, s.f); + assert(s.l == 7 && s.f == 3); +}