Skip to content

Commit 10918c7

Browse files
committed
C#: Update the printing of extension accessor calls.
1 parent e2c0623 commit 10918c7

File tree

1 file changed

+5
-1
lines changed
  • csharp/ql/lib/semmle/code/csharp/exprs

1 file changed

+5
-1
lines changed

csharp/ql/lib/semmle/code/csharp/exprs/Call.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ class MethodCall extends Call, QualifiableExpr, LateBindableExpr, @method_invoca
288288

289289
override Method getQualifiedDeclaration() { result = this.getTarget() }
290290

291-
override string toString() { result = "call to method " + concat(this.getTarget().getName()) }
291+
override string toString() {
292+
if exists(this.getTargetAccessor())
293+
then result = "call to extension accessor " + concat(this.getTargetAccessor().getName())
294+
else result = "call to method " + concat(this.getTarget().getName())
295+
}
292296

293297
override string getAPrimaryQlClass() { result = "MethodCall" }
294298

0 commit comments

Comments
 (0)