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

Member predicate LocalConstantDeclExpr::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 _))
    ...
LocalConstant getVariable()