summaryrefslogtreecommitdiff
path: root/mcs/tests/test-644.cs
blob: 6051d12816fb29e720e656c63524380109a76235 (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
49
50
using System;

class Program
{
	public delegate object D (int member);

	private D _value;

	private object M (int member)
	{
		return null;
	}

	void Test_1 ()
	{
		Delegate d1 = M + _value;
		Delegate d2 = _value + M;
	}

	public bool Test_2 ()
	{
		return _value == M;
	}

	public bool Test_3 ()
	{
		return _value != M;
	}
	
	public bool Test_4 (D d)
	{
		return d == _value;
	}
	
	public static int Main ()
	{
		Program p = new Program ();
		if (p.Test_2 ())
			return 1;
		p._value = p.M;
		if (!p.Test_2 ())
			return 2;
		
		if (p.Test_3 ())
			return 3;
		
		Console.WriteLine ("OK");
		return 0;
	}
}