What is the limit of what you can do with reflecti...
# multiplatform
r
What is the limit of what you can do with reflection in kotlin MPP? Can you do something simple like
this::class.simpleName
? Is there a list of things part of
stdlib
?
s
I think it depends on the platform. A different concrete KClass if used dependent on platform, for example the one on JS is basically primitive at the moment with only isInstance and simpleName
So if you're hoping to do a lot of reflection across platforms in a platform independent way... then computer says no
r
Yes I saw that there was not much but I was wondering what was there. It looks like you don’t even have
simpleName
on JVM/Android if you don’t have
kotlin-reflect
So to have
simpleName
available everywhere (for me Android & iOS) I need to have
kotlin-reflect
on the Android side
o
Reflection more frequently abused than used anyway, so maybe less MPP reflection is good.