Hey, I'm having a little trouble calling Kotlin fr...
# announcements
j
Hey, I'm having a little trouble calling Kotlin from Java. I have the following method in Kotlin:
Copy code
fun <T> then(onSuccess: (TSuccess) -> Result<T, TFailure>): Result<T, TFailure>
I'm able to call it from Java as follows
Copy code
result.then(this::nextStep) // this works with the below method signature

public Result<X, Y> nextStep(X value) {
   ...
}
But I can't seem to find a way to find a type that I can pass in. I've tried the following:
Copy code
result.then(ifCondition(this::nextStep)) // this fails given the below signature of `ifCondition`

public Function<X, Result<X, Y>> ifCondition(Function<X, Result<X, Y>> block)
Any help would be greatly appreciated. 🙂