Merge pull request #877 from hvitved/csharp/matches-handle

C#: Use `matchesHandle()` instead of `getLabel()`
This commit is contained in:
Calum Grant
2019-02-06 11:02:09 +00:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -28,13 +28,13 @@ class Declaration extends DotNet::Declaration, Element, @cil_declaration {
final predicate isSourceDeclaration() { this = getSourceDeclaration() }
}
private CS::Declaration toCSharpNonTypeParameter(Declaration d) { result.getLabel() = d.getLabel() }
private CS::Declaration toCSharpNonTypeParameter(Declaration d) { result.matchesHandle(d) }
private CS::TypeParameter toCSharpTypeParameter(TypeParameter tp) {
toCSharpTypeParameterJoin(tp, result.getIndex(), result.getGeneric())
}
pragma[noinline, nomagic]
pragma[nomagic]
private predicate toCSharpTypeParameterJoin(TypeParameter tp, int i, CS::UnboundGeneric ug) {
exists(TypeContainer tc |
tp.getIndex() = i and

View File

@@ -93,7 +93,7 @@ class NamedElement extends Element, @dotnet_named_element {
predicate compiledFromSource() {
not this.fromSource() and
exists(NamedElement other | other != this |
other.getLabel() = this.getLabel() and
this.matchesHandle(other) and
other.fromSource()
)
}