Hiosdra
06/01/2020, 11:30 AMIO<Nothing, A>
Kotlin compiler(??? or Jvm?) erases all information about generics in this class. If method returns IO<E, A>
where E is any type but Nothing
, generic info is kept.
Retrofit integration needs generic info, because Retrofit is a runtime library. I’ve also tested merged into master suspend + Either integration and it fails in the same place.
Do anyone has some more knowledge about bytecode representation of Nothing
and why compiler/Jvm do that only for Nothing
type?
Below are photos with brakepoint on adapterType = method.getGenericReturnType()
(HttpServiceMethod.java:62)raulraja
06/01/2020, 3:01 PMstojan
06/01/2020, 5:02 PMsuspend fun getUser(): User
directly if you don't expect HTTP errors