209315baad
It fixed the compiler crashing when translating `for`/`when`/`if` with `when` statement(KT-5234) and KT-5058. #KT-5234 fixed #EA-57346 fixed #KT-5058 fixed
26 lines
416 B
Kotlin
Vendored
26 lines
416 B
Kotlin
Vendored
package foo
|
|
|
|
fun test():Any {
|
|
val a: Any = "OK"
|
|
val f: Any =
|
|
if (true) {
|
|
when {
|
|
false -> "1"
|
|
((a as? String)?.size ?: 0 > 0) -> a
|
|
else -> "2"
|
|
}
|
|
}
|
|
else {
|
|
"3"
|
|
|
|
}
|
|
|
|
return f
|
|
}
|
|
|
|
fun box(): Boolean {
|
|
var result = test()
|
|
return result == "OK";
|
|
}
|
|
|