There's a "library solution" for `typeOf<T>(...
# language-proposals
d
There's a "library solution" for
typeOf<T>()
that will get you a generic JVM type, but it'd cost a class file for each call site at the moment. --- That's getKType from the gist above ;)
m
But since it goes through
javaClass
it will lose variance and nullability info, wouldn’t it?
p
@dmitry.petrov I’ve yet to see an implementation of
typeOf<T>()
that doesn’t give a crippled
KType
. I’d love to have one!