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

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.


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()