is there a way to have a unique method for both Java and Kotlin that plays nice with lambda?
Copy code
inline fun method(lambda: () -> Unit) // Java needs at the end `return Unit.INSTANCE;`
void method(Runnable lambda) // Kotlin needs to wrap it into `Runnable { }` and you dont have inline
elect
05/13/2019, 2:08 PM
how?
d
david-wg2
05/13/2019, 2:09 PM
Copy code
void myMethod(Runnable runnable) {
}
r
ribesg
05/13/2019, 2:12 PM
You should be able to have both java files and kotlin files in any kotlin project. Obviously not in the same file
e
elect
05/13/2019, 2:12 PM
I'd lose the
inline
s
Stephan Schroeder
05/13/2019, 3:00 PM
not on the Kotlin side. Do you try to trick Java into inlining?