Rob Elliot
05/17/2021, 7:56 AM@JvmSynthetic to internal members to properly hide them from Java:
https://medium.com/scalereal/hide-internal-members-of-kotlin-module-from-jvm-c7730507fb17
which informed me of @JvmSynthetic https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-synthetic/
which in turn led me to ACC_SYNTHETIC
https://docs.oracle.com/javase/specs/jvms/se15/html/jvms-4.html
Is there a reason why the compiler with the JVM backend doesn’t just add the ACC_SYNTHETIC access_flag to internal methods without needing to add the noise of an extra annotation?Rob Elliot
05/17/2021, 8:04 AMinternal Kotlin member from Java… though I’ve always thought that a pretty odd thing to do.Ilmir Usmanov [JB]
05/17/2021, 10:06 AMsynthetic is for synthetic declarations and some tools, most notably IntelliJ debugger usually skip them.
There is another way to hide Kotlin internal functions from Java, which does not affect tools so much - @JvmName with a dash in new name.Rob Elliot
05/17/2021, 10:08 AM$library at the end of the name from Java is responsible for their own pain when I rename / delete it!