Files
kotlin-fork/compiler/testData/codegen/boxInline/anonymousObject/kt19399.kt
T
2022-07-14 23:24:18 +02:00

42 lines
649 B
Kotlin
Vendored

// WITH_STDLIB
// FILE: 1.kt
class Foo {
var bar = ""
inline fun ifNotBusyPerform(action: (complete: () -> Unit) -> Unit) {
action {
bar += "K"
}
}
fun ifNotBusySayHello() {
ifNotBusyPerform {
bar += "O"
it()
}
}
inline fun inlineFun(s: () -> Unit) {
s()
}
fun start() {
inlineFun {
{
ifNotBusyPerform {
ifNotBusySayHello()
}
}.let { it() }
}
}
}
// FILE: 2.kt
fun box(): String {
val foo = Foo()
foo.start()
return foo.bar
}