Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c5b30d

Browse files
committed
C#: Update CIL consistency test
1 parent f225a17 commit 6c5b30d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • csharp/ql/test/library-tests/cil/consistency

csharp/ql/test/library-tests/cil/consistency/Handles.ql

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ query predicate tooManyHandles(string s) {
1717
)
1818
}
1919

20+
private class UniqueMetadataEntity extends MetadataEntity {
21+
UniqueMetadataEntity() {
22+
// Tuple types such as `(,)` and `ValueTuple`2` share the same handle
23+
not this instanceof TupleType and
24+
not this.getQualifiedName().matches("System.ValueTuple%")
25+
}
26+
}
27+
2028
query predicate tooManyMatchingHandles(string s) {
21-
exists(MetadataEntity e, Assembly a, int handle |
29+
exists(UniqueMetadataEntity e, Assembly a, int handle |
2230
metadata_handle(e, a, handle) and
23-
strictcount(MetadataEntity e2 | metadata_handle(e2, a, handle)) > 2 and
31+
strictcount(UniqueMetadataEntity e2 | metadata_handle(e2, a, handle)) > 2 and
2432
s = e.getQualifiedName()
2533
)
2634
}

0 commit comments

Comments
 (0)