Files
kotlin-fork/compiler/testData/codegen/boxInline/anonymousObject/capturedLocalFun.kt
T
Alexander Udalov 24aee1cce3 JVM IR: unmute tests on anonymous objects in inline lambdas
All tests on anonymous objects should use the NO_CHECK_LAMBDA_INLINING
directive, since the test framework can't tell an anonymous object from
a lambda and checking that anonymous objects are "inlined" makes no
sense.
2020-09-02 16:46:04 +02:00

26 lines
381 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_MULTI_MODULE: JVM
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test
inline fun <T> myRun(block: () -> T) = block()
// FILE: 2.kt
import test.*
fun box(): String {
val y = "O"
val x = myRun {
fun foo() = y + "K"
val o = object {
fun bar() = foo()
}
o
}
return x.bar()
}