Another quick question: Is there a way to "unreif...
# announcements
a
Another quick question: Is there a way to "unreify" a function call? As in I have a library function that provides a
Copy code
inline fun <reified T : Any> reifiedFun() {...}
And I have a generic class, which does not allow for reified parameters, and I want to use that library's reified interface
Copy code
class <A: Any> Test(val javaType: JavaType) {
   fun useIt() {
      // Here is the confusing part
      reifiedFun<A>(javaType); ????
   }
}
e
no, it's not possible. ideally the library should expose a generic function plus a reified convenience function
a
Ah, actually this library is kotlinx.serialization
Which I may be missing something then; I'd imagine it would expose a generic function. Particularly for
Json.encodeAsString(object)
I guess
encodeToString(serializationStrategy, object)
does what I need, thanks!
a
I guess there was a overload which takes a serializer in the first parameter... Oh you already found that 😅