@@ -164,8 +164,6 @@ module CfgImpl {
164164 not this = any ( Go:: SelectStmt sel ) .getBody ( )
165165 }
166166
167- override Stmt getStmt ( int n ) { result = Go:: BlockStmt .super .getStmt ( n ) }
168-
169167 Stmt getLastStmt ( ) {
170168 exists ( int last | result = this .getStmt ( last ) and not exists ( this .getStmt ( last + 1 ) ) )
171169 }
@@ -183,10 +181,8 @@ module CfgImpl {
183181 Expr getExpr ( ) { result = Go:: ExprStmt .super .getExpr ( ) }
184182 }
185183
186- class IfStmt extends Stmt {
187- IfStmt ( ) { this instanceof Go:: IfStmt }
188-
189- Expr getCondition ( ) { result = this .( Go:: IfStmt ) .getCond ( ) }
184+ class IfStmt extends Stmt instanceof Go:: IfStmt {
185+ Expr getCondition ( ) { result = this .( Go:: IfStmt ) .getCondition ( ) }
190186
191187 Stmt getThen ( ) { result = this .( Go:: IfStmt ) .getThen ( ) }
192188
@@ -195,9 +191,7 @@ module CfgImpl {
195191
196192 AstNode getIfInit ( IfStmt ifstmt ) { result = ifstmt .( Go:: IfStmt ) .getInit ( ) }
197193
198- class LoopStmt extends Stmt {
199- LoopStmt ( ) { this instanceof Go:: LoopStmt }
200-
194+ class LoopStmt extends Stmt instanceof Go:: LoopStmt {
201195 Stmt getBody ( ) { result = this .( Go:: LoopStmt ) .getBody ( ) }
202196 }
203197
@@ -219,19 +213,15 @@ module CfgImpl {
219213 Expr getCondition ( ) { none ( ) }
220214 }
221215
222- class ForStmt extends LoopStmt {
223- ForStmt ( ) { this instanceof Go:: ForStmt }
224-
216+ class ForStmt extends LoopStmt instanceof Go:: ForStmt {
225217 AstNode getInit ( int index ) { index = 0 and result = this .( Go:: ForStmt ) .getInit ( ) }
226218
227219 Expr getCondition ( ) { result = this .( Go:: ForStmt ) .getCond ( ) }
228220
229221 AstNode getUpdate ( int index ) { index = 0 and result = this .( Go:: ForStmt ) .getPost ( ) }
230222 }
231223
232- class ForeachStmt extends LoopStmt {
233- ForeachStmt ( ) { this instanceof Go:: RangeStmt }
234-
224+ class ForeachStmt extends LoopStmt instanceof Go:: RangeStmt {
235225 // Go's `range` statement binds its key and value by destructuring the
236226 // current element. The extractor synthesizes a single "range element"
237227 // node grouping the key and value (see `Go::RangeElementExpr`), which we
@@ -249,9 +239,7 @@ module CfgImpl {
249239
250240 class GotoStmt = Go:: GotoStmt ;
251241
252- class ReturnStmt extends Go:: ReturnStmt {
253- override Expr getExpr ( ) { result = Go:: ReturnStmt .super .getExpr ( ) }
254- }
242+ class ReturnStmt = Go:: ReturnStmt ;
255243
256244 class Throw extends AstNode {
257245 Throw ( ) { none ( ) }
@@ -281,9 +269,7 @@ module CfgImpl {
281269 Stmt getBody ( ) { none ( ) }
282270 }
283271
284- class Switch extends AstNode {
285- Switch ( ) { this instanceof Go:: SwitchStmt }
286-
272+ class Switch extends AstNode instanceof Go:: SwitchStmt {
287273 Expr getExpr ( ) {
288274 result = this .( Go:: ExpressionSwitchStmt ) .getExpr ( )
289275 or
0 commit comments