Ok, one last question - I need to know the class (...
# reflect
v
Ok, one last question - I need to know the class (KClass) of each constructor parameter so I can check it in a
when
block. Something like
Copy code
for(consP in primaryConstructor.parameters) { when(consP.type) { is kotlin.String -> \\ do String thing; is <http://kotlin.Int|kotlin.Int> -> \\ do Int thing } }
but
consP.type
is a
KType
and I can't get at the underlying KClass. Any ideas?