Fedor Bobin
03/30/2018, 7:19 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 genericsDeactivated User
03/30/2018, 7:23 AMDeactivated User
03/30/2018, 7:24 AMFedor Bobin
03/30/2018, 7:43 AMDeactivated User
03/30/2018, 7:43 AMDeactivated User
03/30/2018, 7:46 AM