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

Member predicate SwitchStmt::getStmt

Gets the ith statement in the body of this switch statement.

Example:

switch (x) {
  case "abc":              // i = 0
    return 0;              // i = 1
  case int i when i > 0:   // i = 2
    return 1;              // i = 3
  case string s:           // i = 4
    Console.WriteLine(s);  // i = 5
    return 2;              // i = 6
  default:                 // i = 7
    return 3;              // i = 8
}
Stmt getStmt(int i)