Hi. If I have a KClass<T>, how do I safely ...
# reflect
n
Hi. If I have a KClass<T>, how do I safely cast a value of type Any to a value of type T? I’m looking for a dynamic equivalent to the
as?
operator.
u
n
Yes, I should say… this is a multiplatform project.
For some reason, KClass.cast is not available in JavaScript, although using a reified type parameter with
as?
works.