Is there an idiomatic Kotlin way of doing this (wi...
# getting-started
f
Is there an idiomatic Kotlin way of doing this (with
T
being a reified type paramter)?
Copy code
SomeClass::class.java.isAssignableFrom(T::class.java)
n
T is SomeClass
?
wait, it'd have to be an instance
t is SomeClass
😛
assuming your type
T
is on one of the inputs, which in my experience it usually is
e
Copy code
SomeClass::class.isSuperclassOf(T::class)
(requires kotlin-reflect)
f
oh yeah forgot I didn't have kotlin-reflect, thx a lot!
and no, I do not have an instance of
T
n
can you share the method signature?