Commit fdbc72a
Remove ObjectType parameter checks from System.qll methods
Removes instanceof ObjectType checks from method signatures in System.qll to support
nullable reference types (object?). This fixes false positives when Equals(object?)
is used instead of Equals(object), as they are the same underlying type with different
nullability annotations.
Fixes:
- SystemIComparableInterface.getCompareToMethod()
- SystemObjectClass.getEqualsMethod()
- SystemObjectClass.getStaticEqualsMethod()
- SystemObjectClass.getReferenceEqualsMethod()
Co-authored-by: hvitved <3667920+hvitved@users.noreply.github.com>1 parent c20b948 commit fdbc72a
File tree
2 files changed
+46
-6
lines changed- csharp/ql
- lib/semmle/code/csharp/frameworks
- test/query-tests/API Abuse/ClassDoesNotImplementEquals
2 files changed
+46
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| |||
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
266 | | - | |
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
| |||
273 | 271 | | |
274 | 272 | | |
275 | 273 | | |
276 | | - | |
277 | | - | |
278 | 274 | | |
279 | 275 | | |
280 | 276 | | |
| |||
284 | 280 | | |
285 | 281 | | |
286 | 282 | | |
287 | | - | |
288 | | - | |
289 | 283 | | |
290 | 284 | | |
291 | 285 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments