@@ -832,6 +832,12 @@ class SwitchStmt extends @switchstmt, Stmt, ScopeNode {
832832 /** Gets the init statement of this `switch` statement, if any. */
833833 Stmt getInit ( ) { result = this .getChildStmt ( 0 ) }
834834
835+ /**
836+ * Gets the expression whose value or type is examined by this `switch`
837+ * statement, if any.
838+ */
839+ Expr getExpr ( ) { none ( ) }
840+
835841 /** Gets the body of this `switch` statement. */
836842 BlockStmt getBody ( ) { result = this .getChildStmt ( 2 ) }
837843
@@ -880,8 +886,7 @@ class SwitchStmt extends @switchstmt, Stmt, ScopeNode {
880886 * ```
881887 */
882888class ExpressionSwitchStmt extends @exprswitchstmt, SwitchStmt {
883- /** Gets the switch expression of this `switch` statement. */
884- Expr getExpr ( ) { result = this .getChildExpr ( 1 ) }
889+ override Expr getExpr ( ) { result = this .getChildExpr ( 1 ) }
885890
886891 override predicate mayHaveSideEffects ( ) {
887892 this .getInit ( ) .mayHaveSideEffects ( ) or
@@ -912,14 +917,13 @@ class ExpressionSwitchStmt extends @exprswitchstmt, SwitchStmt {
912917 * ```
913918 */
914919class TypeSwitchStmt extends @typeswitchstmt, SwitchStmt {
915- /** Gets the assign statement of this type-switch statement. */
916920 SimpleAssignStmt getAssign ( ) { result = this .getChildStmt ( 1 ) }
917921
918922 /** Gets the test statement of this type-switch statement. This is a `SimpleAssignStmt` or `ExprStmt`. */
919923 Stmt getTest ( ) { result = this .getChildStmt ( 1 ) }
920924
921925 /** Gets the expression whose type is examined by this `switch` statement. */
922- Expr getExpr ( ) {
926+ override Expr getExpr ( ) {
923927 result = this .getAssign ( ) .getRhs ( ) or result = this .getChildStmt ( 1 ) .( ExprStmt ) .getExpr ( )
924928 }
925929
0 commit comments