linux-packaging-mono/mcs/tests/test-anon-81.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

42 lines
472 B
C#

using System;
class C
{
public static int Main ()
{
if (new C ().Test () != 6)
return 1;
return 0;
}
public delegate void Cmd ();
public delegate int Cmd2 ();
int Test ()
{
int r = Foo2 (delegate () {
int x = 4;
Foo (delegate () {
int y = 6;
Foo (delegate () {
x = y;
});
});
return x;
});
Console.WriteLine (r);
return r;
}
int Foo2 (Cmd2 cmd)
{
return cmd ();
}
void Foo (Cmd cmd)
{
cmd ();
}
}