i'm trying to call a jdbi-method from kotlin, and ...
# announcements
t
i'm trying to call a jdbi-method from kotlin, and i get:
Copy code
Type inference failed: Not enough information to infer parameter X in 
fun <R : Any!, X : Exception!> withHandle(callback: ((handle: Handle!) → R!)!): R!
Please specify it explicitly.
the method signature is
public <R, X extends Exception> R withHandle(HandleCallback<R, X> callback) throws X {
what am i supposed to do in this case?
g
What is your code? Did you try to just specify types explicitly?
t
just the example from the jdbi page:
Copy code
val names = jdbi.withHandle({ handle ->
            handle.createQuery("select name from contacts")
                    .mapTo(String::class.java)
                    .list()
        })
i don't know how to specify the type of the exception
g
jdbi.withHandle<R, Exception>
?
t
🤔
thank you