Files
kotlin/compiler/testData/codegen/boxInline/anonymousObject/kt19389.kt
2019-02-05 16:14:50 +01:00

24 lines
395 B
Kotlin
Vendored

// FILE: 1.kt
public inline fun <T, R> myWith(receiver: T, block: T.() -> R): R {
return receiver.block()
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
object Foo2 {
operator fun Any?.get(key: String) = "OK"
}
object Main {
fun bar() = myWith(Foo2) {
val x = object {
val y = 38["Hello!"]
}
x.y
}
}
fun box(): String {
return Main.bar()
}