Files
codeql/csharp/ql/test/query-tests/API Abuse/InconsistentEqualsGetHashCode/InconsistentEqualsGetHashCode.cs
2018-08-02 17:53:23 +01:00

42 lines
573 B
C#

using System;
class ClassMissingGetHashCode
{
public override bool Equals(object other)
{
return false;
}
public new int GetHashCode()
{ // not overridden
return 42;
}
}
class ClassMissingEquals
{
public new bool Equals(object other)
{ // not overridden
return false;
}
public override int GetHashCode()
{
return 42;
}
}
class Class
{
public override bool Equals(object other)
{
return false;
}
public override int GetHashCode()
{
return 42;
}
}