Files
kotlin-fork/compiler/testData/codegen/box/classes/kt1535.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

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"
}