https://kotlinlang.org logo
#announcements
Title
# announcements
x

xenoterracide

06/10/2019, 4:43 PM
if not Double::class what should I be comparing it to?
s

Shawn

06/10/2019, 4:45 PM
what’s the type of
returnType
?
x

xenoterracide

06/10/2019, 4:45 PM
KType
s

Shawn

06/10/2019, 4:46 PM
I haven’t worked with that type before but I know that comparison isn’t going to work since
Double::class
yields a
KClass<Double>
x

xenoterracide

06/10/2019, 4:48 PM
sure, I’m just not sure how I’m going to get a KType
s

Shawn

06/10/2019, 4:48 PM
if you’re in the weeds with reflection already, I think you might be able to use
Double::class.starProjectedType
lives under
kotlin.reflect.full
x

xenoterracide

06/10/2019, 4:53 PM
doesn’t look like it
guess maybe I should just use java’s reflection api
or something elses reflection utils
m

Marc Knaup

06/10/2019, 5:26 PM
property.returnType.classifier == Double::class
2 Views