Fedor Bobin
03/30/2018, 7:51 AMhttpClient.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 genericselizarov
03/30/2018, 11:15 AMmiha-x64
03/31/2018, 3:12 PMTypeToken
will work here correctly.