CodeQL library for C#
codeql/csharp-all 3.1.1 (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()