mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
C#: Adjust implementation to use the shared model printer.
This commit is contained in:
@@ -376,7 +376,7 @@ private predicate callableInfo(Callable c, string name, UnboundValueOrRefType de
|
||||
private class InterpretedCallable extends Callable {
|
||||
InterpretedCallable() {
|
||||
exists(string namespace, string type, string name |
|
||||
partialModel(this, namespace, type, name, _) and
|
||||
partialModel(this, namespace, type, _, name, _) and
|
||||
elementSpec(namespace, type, _, name, _, _)
|
||||
)
|
||||
or
|
||||
@@ -520,32 +520,19 @@ string parameterQualifiedTypeNamesToString(Callable c) {
|
||||
}
|
||||
|
||||
predicate partialModel(
|
||||
UnboundCallable c, string namespace, string type, string name, string parameters
|
||||
Callable c, string namespace, string type, string extensible, string name, string parameters
|
||||
) {
|
||||
QN::hasQualifiedName(c, namespace, type, name) and
|
||||
extensible = getCallableOverride(c) and
|
||||
parameters = "(" + parameterQualifiedTypeNamesToString(c) + ")"
|
||||
}
|
||||
|
||||
/** Computes the first 6 columns for positive CSV rows of `c`. */
|
||||
string asPartialModel(UnboundCallable c) {
|
||||
exists(string namespace, string type, string name, string parameters |
|
||||
partialModel(c, namespace, type, name, parameters) and
|
||||
result =
|
||||
namespace + ";" //
|
||||
+ type + ";" //
|
||||
+ getCallableOverride(c) + ";" //
|
||||
+ name + ";" //
|
||||
+ parameters + ";" //
|
||||
+ /* ext + */ ";" //
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the signature of `c` in the format `namespace;type;name;parameters`.
|
||||
*/
|
||||
string getSignature(UnboundCallable c) {
|
||||
exists(string namespace, string type, string name, string parameters |
|
||||
partialModel(c, namespace, type, name, parameters)
|
||||
partialModel(c, namespace, type, _, name, parameters)
|
||||
|
|
||||
result =
|
||||
namespace + ";" //
|
||||
|
||||
Reference in New Issue
Block a user