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

test-369.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5fa2f9ce434d44644f937fd6edd7d006717250dd (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
class Test {
	static int count;

	static public bool operator == (Test x, Test y)
	{
		++count;
		return false;
	}

	static public bool operator != (Test x, Test y)	{ return true; }
	
	public override bool Equals (object o) { return false; }

	public override int GetHashCode () { return 0; }

	public static void Main ()
	{
		Test y = new Test ();
		if (y == null)
			throw new System.Exception ();
		if (count != 1)
			throw new System.Exception ("Operator == was not called");
	}
}