974df0ed8e
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.
20 lines
342 B
Kotlin
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"
|
|
}
|