When will we have access to kotlin.reflect.full fr...
# multiplatform
j
When will we have access to kotlin.reflect.full from KMM?
l
Never, because it's too heavy for Android anyway.
However, there's some compile time reflection being worked on, which maybe, maybe a few years from now might be usable.
j
Well. It kind of makes a lot of stuff harder, like mocking for test and creating automatic object mappers etc. Most frameworks/platforms/languages has reflection for doing things like that even though you need to be careful about performance.
l
You can replace mocks by fakes, it works fine everywhere and requires no "magic".
For other cases, we tend to use Kotlin compiler or Gradle plugins, or #ksp to generate code at compile time instead of having the cost of reflection affecting operation in production.
For example, kotlinx #serialization relies on a compiler plugin.
j
Of course you can use fakes, but mocking is convenient
l
Fakes are not that inconvenient on the long run
Plus you don't need mental shift, it works just like without fakes
j
Well, I disagree, but it is a matter of opinion I guess. I like the convenience of defining my mock object dynamically instead of having stubbed mock classes, but that looks like the option available at the moment.