eol
[mcs.git] / tests / test-anon-06.cs
blob758bcc70f6de9cece684a1b825da93317647dfba
1 //
2 // Tests capturing of variables
3 //
4 using System;
6 delegate void S ();
8 class X {
9 static int Main ()
11 int a = 1;
12 if (a != 1)
13 return 1;
15 Console.WriteLine ("A is = " + a);
16 S b= delegate {
17 Console.WriteLine ("on delegate");
18 a = 2;
20 if (a != 1)
21 return 2;
22 b();
23 if (a != 2)
24 return 3;
25 Console.WriteLine ("OK");
26 return 0;