summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0252-2.cs
blob: b69253cc460a039fd442de23e3f01b1450609652 (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
// CS0252: Possible unintended reference comparison. Consider casting the left side expression to type `A' to get value comparison
// Line: 15
// Compiler options: -warnaserror

using System;

class A
{
	public override int GetHashCode ()
	{
		return base.GetHashCode ();
	}
	
	public override bool Equals (object obj)
	{
		return obj != this;
	}
	
	public static bool operator == (A left, A right)
	{
		return true;
	}
	
	public static bool operator != (A left, A right)
	{
		return false;
	}
}