Official docs on visibility modifiers in Kotlin say that package-level elements marked private
are be visible only in the module in which they are declared.
So class A
declared in Module1.kt
isn't visible in Module2.kt
. But if I try to add to Module2.kt
it's own class A
I get the Redeclaration: A
error.
Since I can't access in Module2.kt
to Module1
's A
class, why isn't the name A
free to use?