Intended and/or valid uses of @JvmSynthetic?



Recently I had a use case where I wanted to “hide” some Kotlin methods from being called by Java, most of them being “internal” methods (which in my case are becoming “public” when being called by Java)

I stumbled upon this StackOverflow question, which is very similar to my question.

So I have two questions:

  • Is it intended for public use, or should be treated as a “it is there but you shouldn’t use it” type of API?
  • Are there any “intended use cases” when creating this annotation?

My guess is that you guys don’t want to document this annotation because it should be used very very sparingly, so the Kotlin Team don’t want to promote it for use.