I can't find any documentation on how to compare K...
# reflect
s
I can't find any documentation on how to compare KTypes with Class types.
m
snowe: try
p.returnType.classifier == String::class
s
that doesn't compile..
Error:(56, 30) Kotlin: Unresolved reference: classifier
m
I have no Kotlin 1.0.x sources (I use 1.1.x). Maybe anyone knows how to get Class from KType?
s
oh. 😞
u
p.returnType.javaType
returns a
java.lang.reflect.Type
, which is either a
Class
or a
ParameterizedType
or something else, see its subtypes
s
I will try that out. thank you