Hello. I am trying to use ktor-clients that use re...
# announcements
f
Hello. I am trying to use ktor-clients that use reified generics to handle return type and pass it to deserialization routine.
Copy code
httpClient.get<Type>(...): Type <------ return type is handled from reified generic parameter
  
  interface JsonSerializer {
    suspend fun read(type: KClass<*>, content: IncomingContent): Any   <<------ and handled type is used to instantiate object
}
If I pass List<MyObject> as a type parameter, I silently get List of garbage because reified generics does not include inner parameters and only List<*> will be passed to JsonSerializer.read(...) I am wonder why not: 1) either: do not allow to pass classes with inner generics to reified methods 2) or: pass something different then just KClass that supports chain of generics
d
There is a #C0A974TJ9 channel. You can ask issues related to ktor there 🙂
f
A am not asking about ktor itself but about Kotlin state in current question.
d
Oh I see. Then ignore this comment 👍
You can also try in the #C0B9K7EP2 channel