Files
kotlin-fork/compiler/testData/codegen/boxInline/anonymousObject/capturedLocalFunRef.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

24 lines
327 B
Kotlin
Vendored

// 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 x = myRun {
fun foo() = "OK"
val o = object {
val f = ::foo
fun bar() = f()
}
o
}
return x.bar()
}