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)
r
raulraja
06/01/2020, 3:01 PM
I believe the Nothing case would need to be handled manually for the Either encoder