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

Member predicate CaseStmt::getCondition

Gets the condition on this case, if any. For example, the type case on line 3 has no condition, and the type case on line 4 has condition s.Length > 0, in

switch(p)
{
    case int i:
    case string s when s.Length > 0:
        break;
    ...
}
Expr getCondition()