Files
codeql/java/ql/test/kotlin/library-tests/no-when-branch-found/test.kt
Chris Smowton 5fe65ed983 Extract no-when-branch-found calls
These are extracted as "throw new kotlin.NoWhenBranchFoundException();", which is the Java lowering of the intrinsic.

In the process, amend the control-flow graph to let when branches propagate `throw`s outwards, and similarly statement expressions.
2022-05-10 19:51:19 +01:00

11 lines
95 B
Kotlin

enum class A {
A1, A2
}
fun test(a: A): Int =
when(a) {
A.A1 -> 1
A.A2 -> 2
}