https://kotlinlang.org logo
Title
n

natario1

08/08/2022, 6:42 PM
My compiler plugin has a companion runtime library. Some functions there have complex logic used by the plugin just because it would be hard to write it in IR. Is there a way to hide these functions from the end user though? For example, I scoped them inside an object to reduce their discoverability, but I’m thinking there must be some better solution.
j

jw

08/08/2022, 6:45 PM
You can mark the
object
as
@PublishedApi
+
internal
. Also slap on a
@JvmSynthetic
so Java callers won't see it. That's probably good enough to thwart all but the most determined callers.
n

natario1

08/08/2022, 6:59 PM
Nice, that will work. Thanks Jake