mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Convert cs/gethashcode-is-not-defined to inline expectations tests.
This commit is contained in:
@@ -6,9 +6,10 @@ public class Test
|
||||
public void M()
|
||||
{
|
||||
var h = new Hashtable();
|
||||
h.Add(this, null); // BAD
|
||||
h.Add(this, null); // $ Alert
|
||||
|
||||
var d = new Dictionary<Test, bool>();
|
||||
d.Add(this, false); // BAD
|
||||
d.Add(this, false); // $ Alert
|
||||
}
|
||||
|
||||
public override bool Equals(object other)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| HashedButNoHash.cs:9:15:9:18 | this access | This expression is hashed, but type 'Test' only defines Equals(...) not GetHashCode(). |
|
||||
| HashedButNoHash.cs:11:15:11:18 | this access | This expression is hashed, but type 'Test' only defines Equals(...) not GetHashCode(). |
|
||||
| HashedButNoHash.cs:12:15:12:18 | this access | This expression is hashed, but type 'Test' only defines Equals(...) not GetHashCode(). |
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
Likely Bugs/HashedButNoHash.ql
|
||||
query: Likely Bugs/HashedButNoHash.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
|
||||
Reference in New Issue
Block a user