Kotlin: Fix enclosing statement of when branches

This commit is contained in:
Tamas Vajk
2022-06-22 09:10:24 +02:00
parent 640026d387
commit a50e062b3c
2 changed files with 10 additions and 1 deletions

View File

@@ -29,7 +29,8 @@ class Stmt extends StmtParent, ExprParent, @stmt {
*/
Stmt getEnclosingStmt() {
result = this.getParent() or
result = this.getParent().(SwitchExpr).getEnclosingStmt()
result = this.getParent().(SwitchExpr).getEnclosingStmt() or
result = this.getParent().(WhenExpr).getEnclosingStmt()
}
/** Holds if this statement is the child of the specified parent at the specified (zero-based) position. */