summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0253-2.cs
blob: 6a7579b89bdda232b35522b79b5605ca03fa05df (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
// CS0253: Possible unintended reference comparison. Consider casting the right side expression to type `A' to get value comparison
// Line: 16
// Compiler options: -warnaserror

using System;

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