hey guys, did anyone achieve creating dynamic proxies with Kotlin when targeting multiplatform?
k
kpgalligan
10/27/2022, 9:58 PM
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
eygraber
10/27/2022, 10:01 PM
FTFY đ
a
agrosner
10/27/2022, 10:57 PM
Can probably inject byte code with a compiler plugin (risky and prone to error)
k
kpgalligan
10/28/2022, 1:30 AM
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.