In https://kotlinlang.org/docs/reference/visibility-modifiers.html it says
Packages : If you mark a declaration private, it will only be visible inside the file containing the declaration;
But I have a package X
and have file A.kt
package X
private data class D(val a:Int)
and file B.kt
package X
private data class D(val a:Int)
I get redefinition errors both from IDE and compiler. Am I understanding incorrectly ? Shouldn’t I be allowed to name the class with same name in A and B, since it is only visible within the “file containing the declaration” ?
Thanks