summaryrefslogtreecommitdiff
path: root/mcs/tests/test-anon-140.cs
blob: e027b7e8570067472981513b4b8f1bdebbfd0a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;

public static class RunTests
{
	public static int Main ()
	{
		Test1.X.Run ();
		return 0;
	}
}

namespace Test1
{
	delegate int Foo ();

	public class X
	{
		public static void Test1<R> (R r, int a)
		{
			for (int b = a; b > 0; b--) {
				R s = r;
				Console.WriteLine (s);
				Foo foo = delegate {
					Console.WriteLine (b);
					Console.WriteLine (s);
					Console.WriteLine (a);
					Console.WriteLine (r);
					return 3;
				};
				a -= foo ();
			}
		}

		public static void Run ()
		{
			Test1 (500L, 2);
		}
	}
}