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.
21 lines
370 B
Kotlin
21 lines
370 B
Kotlin
class Works() : jet.Function0<Object> {
|
|
public override fun invoke():Object {
|
|
return "Works" as Object
|
|
}
|
|
}
|
|
class Broken() : jet.Function0<String> {
|
|
public override fun invoke():String {
|
|
return "Broken"
|
|
}
|
|
}
|
|
|
|
fun box(): String {
|
|
val works1: ()->Object = Works();
|
|
works1()
|
|
|
|
val broken1: ()->String = Broken();
|
|
broken1()
|
|
|
|
return "OK"
|
|
}
|