summaryrefslogtreecommitdiff
path: root/mcs/tests/test-anon-170.cs
blob: ef239d3e936baf440f4640f5ea0212a5b5244481 (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
42
43
44
45
46
47
48
using System;

public class MyClass
{
	Func<int> ll;

	int Test (int a)
	{
		return 1;
	}

	public void Run ()
	{
		Action<int> a = l => {
			ll = () => l;
		};

		a (1);

		Action<int> a2 = l => {
			ll = () => l;
		};

		a2 (2);
	}

	public void Run2 ()
	{
		Action<int> a = l => {
			ll = () => Test (l);
		};

		a (1);

		Action<int> a2 = l => {
			ll = () => Test (l);
		};

		a2 (1);
	}

	public static void Main ()
	{
		var mc = new MyClass ();
		mc.Run ();
		mc.Run2 ();
	}
}