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: c20adfe27ccbfa600c3e533eb9df4941af3311e5 (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; }

	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");
	}
}