Official documents on visibility modifiers in Kotlin say that package-level elements marked privateare visible only in the module in which they are declared.
So the class Adeclared in Module1.ktdoes not appear in Module2.kt. But if I try to add to Module2.ktmy own class A, I get an error Redeclaration: A.
Since I can't access the class Module2.ktbefore Module1 A, why can't I use the name A?
source
share