Files
kotlin-fork/backend.native/tests/external/codegen/box/objects/objectLiteralInClosure.kt
T
2017-03-13 15:31:46 +03:00

18 lines
315 B
Kotlin

package p
private class C(val y: Int) {
val initChild = { ->
object {
override fun toString(): String {
return "child" + y
}
}
}
}
fun box(): String {
val c = C(3).initChild
val x = c().toString()
return if (x == "child3") "OK" else x
}