I want inherit java class from kotlin's `Function0...
# announcements
s
I want inherit java class from kotlin's
Function0<Unit>
but getting
Copy code
return type void is not compatible with Unit
  where R is a type-variable:
    R extends Object declared in interface Function0
from the other hand i can't specify return type as
kotlin.Unit
in java. Is there any way to do it?
stackoverflow 1
m
stepango: you can use
kotlin.Unit
type and
kotlin.Unit.INSTANCE
object from Java.
s
in this case I'm getting
funname clashes with funname; incompatible return type
m
Copy code
public class KFuncExample implements kotlin.jvm.functions.Function0<Unit> {
    @Override public Unit invoke() {
        return Unit.INSTANCE;
    }
}