mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
Specifically, defer the removal of hand-written "if (true|false)" from JvmBuiltinOptimizationLowering into codegen so that appropriate debug info (and a NOP) can be inserted. Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
20 lines
475 B
Kotlin
Vendored
20 lines
475 B
Kotlin
Vendored
fun foo(b: Boolean): String {
|
|
return if (b) {
|
|
"fail: reached unexpected code at line 3"
|
|
} else if (false) {
|
|
"fail: reached unreachable code at line 5"
|
|
} else if (true) {
|
|
"OK"
|
|
} else if (true) {
|
|
"fail: reached unreachable code at line 9"
|
|
} else if (b) {
|
|
"fail: reached unreachable code at line 11"
|
|
} else {
|
|
"fail: reached unreachable code at line 13"
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
return foo(false)
|
|
}
|