Files
kotlin-fork/compiler/testData/codegen/box/closures/closureOnTopLevel2.kt
T
Alexander Udalov 974df0ed8e Use FunctionImplN instead of FunctionN in codegen
Superclass of closures should now be FunctionImplN instead of FunctionN. Since
these -Impl classes are needed only in JVM, the corresponding descriptors and
types are created in the back-end only.
2013-04-22 17:59:29 +04:00

20 lines
342 B
Kotlin

val p = { "OK" }()
val getter: String
get() = { "OK" }()
fun f() = { "OK" }()
val obj = object : Function0<String> {
override fun invoke() = "OK"
}
fun box(): String {
if (p != "OK") return "FAIL"
if (getter != "OK") return "FAIL"
if (f() != "OK") return "FAIL"
if (obj() != "OK") return "FAIL"
return "OK"
}