https://kotlinlang.org logo
Title
n

Norbi

01/04/2022, 12:51 PM
Hello, Is there a mature example of creating a
java.lang.reflect.Proxy
for a Kotlin interface with
suspend
methods? (I would call the proxy methods only from Kotlin code.) Thanks.
j

jw

01/04/2022, 1:11 PM
You can look at the internals of Retrofit, but it's a bit abstracted
Can start there
Retrofit is written in Java, but I suspect you might actually be required to have some Java even if your project is all Kotlin because you need to pass the continuation to the altered function signature
y

yschimke

01/04/2022, 2:12 PM
The
UndeclaredThrowableException
issue seems nasty.
j

jw

01/04/2022, 2:29 PM
Definitely surprising and took a while to debug. Got a good blog post out of it, though.