@@ -504,7 +504,7 @@ class SwitchCase extends Stmt, @case {
504504 */
505505class ConstCase extends SwitchCase {
506506 ConstCase ( ) {
507- exists ( Expr e | e .getParent ( ) = this and e .getIndex ( ) >= 0 and not e instanceof Pattern ) and
507+ exists ( Expr e | e .getParent ( ) = this and e .getIndex ( ) >= 0 and not e instanceof PatternExpr ) and
508508 // For backward compatibility, we don't include `case null, default:` here, on the assumption
509509 // this will come as a surprise to CodeQL that predates that statement's validity.
510510 not isNullDefaultCase ( this )
@@ -532,12 +532,12 @@ class ConstCase extends SwitchCase {
532532 *
533533 * Note binding patterns are represented as `LocalVariableDeclExpr`s.
534534 */
535- class Pattern extends Expr {
536- Pattern ( ) {
535+ class PatternExpr extends Expr {
536+ PatternExpr ( ) {
537537 (
538538 this .getParent ( ) instanceof SwitchCase or
539539 this .getParent ( ) instanceof InstanceOfExpr or
540- this .getParent ( ) instanceof Pattern
540+ this .getParent ( ) instanceof PatternExpr
541541 ) and
542542 ( this instanceof LocalVariableDeclExpr or this instanceof RecordPatternExpr )
543543 }
@@ -555,12 +555,12 @@ class Pattern extends Expr {
555555
556556/** A pattern case of a `switch` statement */
557557class PatternCase extends SwitchCase {
558- Pattern pattern ;
558+ PatternExpr pattern ;
559559
560560 PatternCase ( ) { pattern .isNthChildOf ( this , 0 ) }
561561
562562 /** Gets this case's pattern. */
563- Pattern getPattern ( ) { result . isNthChildOf ( this , 0 ) }
563+ PatternExpr getPattern ( ) { result = pattern }
564564
565565 /** Gets the guard applicable to this pattern case, if any. */
566566 Expr getGuard ( ) { result .isNthChildOf ( this , - 3 ) }
0 commit comments