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

Member predicate LocalScopeVariable::isCaptured

Holds if this variable is captured by a nested callable. For example, v is captured by the nested lambda expression in

void M() {
  var v = "captured";
  Action a = () => {
    System.Console.WriteLine(v);
  }
}
predicate isCaptured()