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

Member predicate Callable::getExpressionBody

Gets the expression body of this callable (if any), specified by =>.

Normally, each callable will have at most one expression 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() => 0;
  }
}

and later B.cs

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

then both 0 and 1 are expression bodies of N.C.M().

Expr getExpressionBody()