kotlinx-atomicfu icon indicating copy to clipboard operation
kotlinx-atomicfu copied to clipboard

[jvm] bug: variable not found when using public delegated property

Open ArcticLampyrid opened this issue 4 years ago • 2 comments

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.

ArcticLampyrid avatar May 03 '21 02:05 ArcticLampyrid

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.

mvicsokolova avatar Aug 08 '21 21:08 mvicsokolova

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.

lukellmann avatar Apr 23 '22 18:04 lukellmann

JVM IR transformation doesn't seem to have this issue.

lukellmann avatar Jan 03 '23 16:01 lukellmann

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.

mvicsokolova avatar Nov 20 '23 10:11 mvicsokolova