mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Local returns normalization can generate POP instructions. These POP instructions can drop functional parameters, as in KT-17590, and should be processed in markPlacesForInlineAndRemoveInlinable just as other POP instructions. KT-17590 conditional return in inline function parameter argument causes compilation exception
10 lines
204 B
Kotlin
Vendored
10 lines
204 B
Kotlin
Vendored
fun foo(x: Any?, y: Any?) = 0L
|
|
|
|
inline fun test(value: Any?): Long {
|
|
return foo(null, value ?: return 1L)
|
|
}
|
|
|
|
fun box(): String {
|
|
val t = test(null)
|
|
return if (t == 1L) "OK" else "fail: t=$t"
|
|
} |