[jvm] bug: variable not found when using public delegated property
My code: (RpcChannel.service)
ArcticLampyrid/KtJsonRpcPeer@e5559a8eec33aa28ab98efb64e836d561292353b (fixed by ArcticLampyrid/KtJsonRpcPeer@644a12afe9e14ae2fc8f6ec6220f6cbef950df08 via abandoning delegate)
Note that it works well when used in its own project, but when other projects use it as a dependency, error occurs. Example / Build log
e: /home/jitpack/build/src/commonMain/kotlin/ubot/common/UBotClientHost.kt: (160, 17): Unresolved reference: service
e: /home/jitpack/build/src/commonMain/kotlin/ubot/common/UBotClientHost.kt: (189, 17): Unresolved reference: service
I don't test JVM IR backend.
Thank you for the report and sorry for the delayed answer.
I guess it is a bug in visibility modifiers for fields generated during transformation of delegated properties.
I also came across this and it doesn't seem to be a problem with the generated visibility modifiers but instead a missing entry in the generated @kotlin.Metadata annotation. I'm able to access getters and setters from java just fine.
JVM IR transformation doesn't seem to have this issue.
I can not reproduce this issue anymore with the latest version of JVM IR transformation provided in 0.23.0 atomicfu release. If any further problems arise, feel free to reopen this issue.