d

    Dario Pellegrini

    1 year ago
    Is there a way in Kotlin to print through reflection the type o a class like Selected<Person>? The goal is to print “Selected<Person>“, but with normal reflection methods it is not possible. The only result at runtime is “Selected”.
    d

    diesieben07

    1 year ago
    A class (as in
    KClass
    ) can not represent that. You need a
    KType
    , which you can get using
    typeOf<Selected<Person>>()
    d

    Dario Pellegrini

    1 year ago
    Nice! It works! Thank you very much!
    Unfortunately type of needs for ExperimentalStdlibApi, but I think it is the only option