ribesg
03/04/2019, 3:37 PMreified
) generics with the ktor client?suspend fun <T> get(url: String): T =
client.get(url)
e5l
03/05/2019, 7:35 AMT
do you want to use?ribesg
03/05/2019, 9:00 AMkotlinx.serialization
, so I guess any data class with the annotation?e5l
03/05/2019, 9:03 AMsuspend fun <T> get(url: String): T =
client.get<T>(url)
?ribesg
03/05/2019, 9:13 AMCannot use 'T' as reified type parameter. Use a class instead.
e5l
03/05/2019, 9:25 AMT
explicitly when the parameter can't be reified cause of type erasure.ribesg
03/05/2019, 9:29 AMe5l
03/05/2019, 9:31 AMinline
methods with reified
with get
like methods. Also you could use call
or get<HttpResponse>
explicitly.