Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7baefbb

Browse files
committed
Kotlin: Add WhenBranch.getWhenExpr()
1 parent 46f103c commit 7baefbb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,6 +2201,11 @@ class WhenBranch extends Top, @whenbranch {
22012201
/** Holds if this is an `else` branch. */
22022202
predicate isElseBranch() { when_branch_else(this) }
22032203

2204+
/** Gets the `when` expression this is a branch of. */
2205+
WhenExpr getWhenExpr() {
2206+
this = result.getBranch(_)
2207+
}
2208+
22042209
override string toString() { result = "... -> ..." }
22052210

22062211
override string getAPrimaryQlClass() { result = "WhenBranch" }

0 commit comments

Comments
 (0)