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

Member predicate LocalVariableDeclExpr::getVariable

Gets the local variable being declared, if any. The only case where no variable is declared is when a discard symbol is used, for example

if (int.TryParse(s, out var _))
    ...
LocalVariable getVariable()