i'm trying to convert a functional interface to ko...
# getting-started
t
i'm trying to convert a functional interface to kotlin:
Copy code
@FunctionalInterface
public interface ErrorHandler {
    void handle(Request request, Response response);
}
i have
typealias ErrorHandler = (request : Request, response : Response) -> Unit
which seems to work fine, except for when i try to call it in java
Copy code
error(500, (req, res) -> {
    // return type expected
});
can i make this work in both languages somehow? (it used to work fine when the project was all java)
v
tipsy: looks like a common problem for kotlin void functions. Try returning
kotlin.Unit
or
null
t
@voddan that's a deal breaker, i'll keep it as java if that's the case
h
Does
Nothing
or
Nothing?
work as the return type?
t
no, i tried that too