hey guys, did anyone achieve creating dynamic prox...
# multiplatform
f
hey guys, did anyone achieve creating dynamic proxies with Kotlin when targeting multiplatform?
k
My zero-voted answer from 2019 🙂 Still true: https://stackoverflow.com/a/54329838/227313. No proxy for native. You could probably do something with JVM/JS in common code, but I won’t speculate on that right now…
e
FTFY 😄
a
Can probably inject byte code with a compiler plugin (risky and prone to error)
k
Oh, sure, compiler plugins are possible. There are limitations, though. For example, we were thinking eventually a mocking library might use compiler plugins to do it’s “magic”, but you can’t run compiler plugins on dependencies, or at least not the last time I looked into that kind of thing (which was a while ago). So, depends what you’re going to do, and of coarse, as you say, risky and prone to error. That, and things are apt to change, so you potentially need to put in more maintenance time with Kotlin releases.