1f9db7cf25
Before this commit the stack wasn't cleared for read variable case. #KT-47168 Fixed
17 lines
393 B
Kotlin
Vendored
17 lines
393 B
Kotlin
Vendored
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
|
// IGNORE_BACKEND: NATIVE
|
|
import kotlin.contracts.*
|
|
|
|
inline fun foo(x: () -> String, y: () -> String): String {
|
|
contract {
|
|
callsInPlace(x, InvocationKind.EXACTLY_ONCE)
|
|
callsInPlace(y, InvocationKind.EXACTLY_ONCE)
|
|
}
|
|
return x() + y()
|
|
}
|
|
|
|
fun box(): String {
|
|
val y = { "K" }
|
|
return foo({ "O" }, y)
|
|
}
|