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

Member predicate Callable::getStatementBody

Gets the statement body of this callable, if any.

Normally, each callable will have at most one statement body, except in the case where the same callable is compiled multiple times. For example, if we compile both A.cs

namespaces N {
  public class C {
    public int M() { return 0; }
  }
}

and later B.cs

namespaces N {
  public class C {
    public int M() { return 1; }
  }
}

then both { return 0; } and { return 1; } are statement bodies of N.C.M().

BlockStmt getStatementBody()