Hi guys, I have a Kotlin module, packaged as a jar, that I use from a Java project
I want to have a method that is visible from my Kotlin classes but not from the java project.
From what I read on the doc (https://kotlinlang.org/docs/reference/visibility-modifiers.html) I thought that
internal
would do the trick but the internal function is visible from java, as : myInternalFunc$my_module_name.
What am I missing ? 🤔
Mmmm read the doc a bit more and saw that internal is mapped to public in java with some name mangling.
Do you know another way to do what I want to do ?
y
yole
11/09/2018, 4:15 PM
there is no way to make a method invisible to the JVM but callable from Kotlin
d
diesieben07
11/09/2018, 4:44 PM
Doesn't
@JvmSynthetic
accomplish this?
k
karelpeeters
11/09/2018, 5:52 PM
Synthetic targets become inaccessible for Java sources at compile time while still being accessible for Kotlin sources.