https://kotlinlang.org logo
Title
m

Marc Knaup

10/23/2017, 9:52 AM
Is
Class
cross-platform? Because
KClass
doesn’t seem to have a replacement for
isAssignableFrom()
.
s

snrostov

10/23/2017, 10:02 AM
KClass.isSubclassOf
/
KClass.isSuperclassOf
?
m

Marc Knaup

10/23/2017, 10:08 AM
😦 I've relied on an outdated post on the web. Shame on me. Thanks for the info! Does that also work with interfaces? How does it handle primitive types and boxing?
s

snrostov

10/23/2017, 10:23 AM
Oh, sorry. Looks like,
KClass.isSubclassOf
/
KClass.isSuperclassOf
not implemented in kotlin native yet.
m

Marc Knaup

10/23/2017, 10:31 AM
But at least it's there so it's likely to become implemented in the near future :)
p

peterholak

10/23/2017, 11:28 AM
m

Marc Knaup

10/23/2017, 11:38 AM
Hmm, there’s no mention of checking sub/superclass relations of a
KClass
. Basically it’s a type-level
is
check, isn’t it? Not sure whether that already counts as reflection 🙂