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

16 lines
266 B
C#

using System;
class Bad
{
private int id;
public Bad(int Id) { this.id = Id; }
public override bool Equals(object other)
{
if (other is Bad b && b.GetType() == typeof(Bad))
return this.id == b.id;
return false;
}
}