Preserve types on local variable declarations.

Alternatively:
} else if (member is ast.SwitchCase) {
  members.add(...);
} else {
  throw 'Expected SwitchCase or SwitchDefault, found $member';
}