typeOf and KType

This method was added in 1.6, but has anyone figured out a use for it? The only thing I have found is that it’s toString() method gives a very nice description of the type, but that’s it.

It seems only to be used in the test package to give a … nice description of a type in an assert

It has an interesting property which is a KClassifier? now all KClass ARE a KClassifier but that is not transitive.

It ALMOST seems like a decent substitute for a ParameterizedTypeReference but it is not a Java Type ( of which Java Class is ), and seems to suffer from the same erasure issues.

There are no extension methods and no other uses in the standard library.

Are there future plans? It seems to be VERY platform dependent

Thoughts or hacks?

Dean S. Jones – Kotlin PO – Wells Fargo

submitted by /u/Dean_S_Jones
[link] [comments]