CodeQL library for C#
codeql/csharp-all 1.0.5-dev (changelog, source)
Search

Member predicate Parameter::getAnAssignedArgument

Gets an argument which is assigned to this parameter in a call to the enclosing callable.

This takes into account both positional and named arguments.

Example:

class C {
  void M(int x, int y = 2, int z = 3) { }

  void CallM() {
    M(4, 5, 6);
    M(1, z: 3);
  }
}

The assigned arguments to x are 1 and 4, the assigned argument to y is 5, and the assigned arguments to z are 3 and 6, respectively.

Expr getAnAssignedArgument()