Files
kotlin/compiler/testData/codegen/box/objects/objectLiteralInClosure.kt
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

18 lines
292 B
Kotlin

package p
class C(val y : Int) {
val initChild = { ->
object : java.lang.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
}