[box-tests] Added a bunch of tests on local objects in inline lambdas

This commit is contained in:
Igor Chevdar
2022-08-04 20:39:39 +03:00
committed by Space
parent 7090a2716a
commit e38f02b53a
17 changed files with 343 additions and 0 deletions
@@ -0,0 +1,24 @@
// NO_CHECK_LAMBDA_INLINING
import kotlin.IllegalStateException
// FILE: 1.kt
inline fun <T> mrun2(noinline block: () -> T, block2: () -> Unit): T { block2(); return block() }
// FILE: 2.kt
fun bar(o: String): String {
val obj = mrun2(
{
object {
fun foo() = o + "K"
}
},
{
fun localFun() = 42
}
)
return obj.foo()
}
fun box() = bar("O")