Files
codeql/csharp/ql/src/API Abuse/IncorrectEqualsSignatureGood.cs
Tom Hvitved 809da42f00 C#: Synchronize a few test files
Synchronized test files with the examples used in query help.
2018-08-30 21:46:37 +02:00

22 lines
335 B
C#

using System;
class Good
{
private int id;
public Good(int Id)
{
this.id = Id;
}
public bool Equals(Good g) =>
this.id == g.id;
public override bool Equals(object o)
{
if (o is Good g && g.GetType() == typeof(Good))
return this.Equals(g);
return false;
}
}