Files
kotlin-fork/compiler/testData/codegen/box/closures/kt19389.kt
T
2020-03-11 16:01:57 +03:00

21 lines
333 B
Kotlin
Vendored

public fun <T, R> myWith(receiver: T, block: T.() -> R): R {
return receiver.block()
}
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()
}