How to check if a `KProperty1` is an enum? I thou...
# reflect
e
How to check if a
KProperty1
is an enum? I thought something like this out to work:
Copy code
prop.returnType::class.isSubclassOf(Enum::class)
e
returnType::class
isn't what you seem to think it is
that will be
KType::class
, not the
KClass
of the type
try
Copy code
prop.returnType.isSubtypeOf(typeOf<Enum<*>>())
e
ah! great suggestion. Will try!