Files
ldc/test/bug24.d
Tomas Lindquist Olsen a9189bd3a9 [svn r54] Added support for nested delegates referencing parent's stack variables.
Replaced tester.sh with a version written in D.
A few bugfixes.
2007-10-22 15:40:56 +02:00

22 lines
287 B
D

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);
}