Is there anything in the stdlib that captures the ...
# reflect
d
Is there anything in the stdlib that captures the class and nullability of a type?
d
KType
would do that, but afaik the only way to obtain it without the reflection library is
typeOf
d
Thanks. I remember now that I was using KType, but it’s hard to get hold of one. Is this https://gist.github.com/udalov/bb6f398c2e643ee69586356fdd67e9b1 still the sanctioned way of converting a reified T to a KType please @udalov?
d
No, the stdlib has
typeOf
intrinsic now.
val myType = typeOf<List<String>>()
works fine
d
Ah, is still @ExperimentalStdlibApi I see but I’ll try it on for size. Cheers