Thread
#reflect
    natpryce

    natpryce

    4 years ago
    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.
    udalov

    udalov

    4 years ago
    natpryce

    natpryce

    4 years ago
    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.