mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 00:21:28 +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
7 lines
169 B
Kotlin
Vendored
7 lines
169 B
Kotlin
Vendored
fun zap(s: String): String? = s
|
|
|
|
inline fun tryZap(s: String, fn: (String) -> String): String {
|
|
return fn(zap(s) ?: return "null")
|
|
}
|
|
|
|
fun box() = tryZap("OK") { it } |