annotate test/nested2.d @ 67:f918f3e2e99e trunk

[svn r71] Fixed accessing parent function arguments from inside nested delegates. Some cleanups in VarExp::toElem.
author lindquist
date Sun, 28 Oct 2007 02:46:06 +0200
parents
children
rev   line source
lindquist@67 1 module nested2;
lindquist@67 2
lindquist@67 3 void func(ref int i)
lindquist@67 4 {
lindquist@67 5 delegate {
lindquist@67 6 assert(i == 3);
lindquist@67 7 i++;
lindquist@67 8 }();
lindquist@67 9 }
lindquist@67 10
lindquist@67 11 void main()
lindquist@67 12 {
lindquist@67 13 int i = 3;
lindquist@67 14 func(i);
lindquist@67 15 assert(i == 4);
lindquist@67 16 }