Files
codeql/csharp/ql/test/query-tests/API Abuse/InconsistentEqualsGetHashCode/InconsistentEqualsGetHashCodeBad.cs
Owen Mansel-Chan 11e99a03d5 C#
2026-06-10 22:57:22 +02:00

16 lines
277 B
C#

using System;
class Bad // $ Alert
{
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;
}
}