Files
kotlin-fork/backend.native/tests/external/codegen/boxInline/anonymousObject/objectInLambdaCapturesAnotherObject.kt
T
2017-03-13 15:31:46 +03:00

28 lines
390 B
Kotlin

// FILE: 1.kt
package test
public inline fun myRun(block: () -> Unit) {
return block()
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box(): String {
var res = ""
myRun {
val x = object {
fun foo() {
res = "OK"
}
}
object {
fun bar() = x.foo()
}.bar()
}
return res
}