addamsson
10/04/2020, 2:49 PMfun someFun(fn: (SomeClass) -> Unit)
I have to explicitly return Unit.INSTANCE
from Java code. Is there a way to fix this (besides writing a helper function)Big Chungus
10/04/2020, 3:31 PMephemient
10/04/2020, 8:08 PMinterface Function<out R>
type so as far as Java is concerned, you always need to return some value for R
.
for the sake of interop, you could define your own SAM or use Java's specialized SAMs returning void, e.g.
fun someFun(fn: Consumer<SomeClass>)
addamsson
10/12/2020, 8:14 PM