Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

30 lines
374 B
C#

//
// Tests capturing of variables
//
using System;
delegate void S ();
class X {
public static int Main ()
{
int a = 1;
if (a != 1)
return 1;
Console.WriteLine ("A is = " + a);
S b= delegate {
Console.WriteLine ("on delegate");
a = 2;
};
if (a != 1)
return 2;
b();
if (a != 2)
return 3;
Console.WriteLine ("OK");
return 0;
}
}