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

dtest-014.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f9a5cf867abe1417d21a3da5d0adb5a3558d52ef (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
class A
{
	public static int operator != (A a, dynamic b)
	{
		return -1;
	}
	
	public static int operator == (A a, dynamic b)
	{
		return +1;
	}
}

public class C
{
	public static bool operator == (C a, object b)
	{
		return ReferenceEquals (a, b);
	}

	public static bool operator != (C a, dynamic b)
	{
		return !ReferenceEquals (a, b);
	}
	
	public static decimal operator -(dynamic p1, C p2)
	{
		return 9;
	}
	
	public static int Main ()
	{
		var c = new C ();
		var v = 1 - c;
		
		if (v != 9)
			return 1;
		
		return 0;
	}
}