Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-anon-78.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9f8b8e47cd7202e49d26a53e94a9993432239b29 (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
using System;

delegate void D1 ();
delegate void D2 ();

public class DelegateTest {
	static void Foo (D1 d)
	{
		d ();
	}
	
	static void Foo (D2 d)
	{
	}

	static int counter = 99;
	public static int Main ()
	{
		Foo (new D1 (delegate {
			counter = 82;
			Console.WriteLine ("In");
		 }));
		 
		 if (counter != 82)
			 return 1;
		 
		 return 0;
	 }
}