2 // Nested anonymous methods tests and capturing of different variables.
9 static D GlobalStoreDelegate;
16 GlobalStoreDelegate ();
17 GlobalStoreDelegate ();
22 int toplevel_local = 0;
25 int anonymous_local = 1;
27 GlobalStoreDelegate = delegate {
28 Console.WriteLine ("var1: {0} var2: {1}", toplevel_local, anonymous_local);
29 anonymous_local = anonymous_local + 1;
32 toplevel_local = toplevel_local + 1;