'private' package members should be visible for subpackages
This commit is contained in:
@@ -48,9 +48,6 @@ public class Visibilities {
|
|||||||
if (parent == fromParent) {
|
if (parent == fromParent) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (fromParent instanceof NamespaceDescriptor) {
|
|
||||||
break; //'private' package members are not visible for subpackages, so when we reach a package, we should stop
|
|
||||||
}
|
|
||||||
fromParent = fromParent.getContainingDeclaration();
|
fromParent = fromParent.getContainingDeclaration();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -77,7 +74,8 @@ public class Visibilities {
|
|||||||
protected boolean isVisible(@NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
protected boolean isVisible(@NotNull DeclarationDescriptorWithVisibility what, @NotNull DeclarationDescriptor from) {
|
||||||
ModuleDescriptor parentModule = DescriptorUtils.getParentOfType(what, ModuleDescriptor.class, false);
|
ModuleDescriptor parentModule = DescriptorUtils.getParentOfType(what, ModuleDescriptor.class, false);
|
||||||
ModuleDescriptor fromModule = DescriptorUtils.getParentOfType(from, ModuleDescriptor.class, false);
|
ModuleDescriptor fromModule = DescriptorUtils.getParentOfType(from, ModuleDescriptor.class, false);
|
||||||
return parentModule == fromModule;
|
assert parentModule != null && fromModule != null;
|
||||||
|
return parentModule.equals(fromModule);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ private object PO {}
|
|||||||
|
|
||||||
//FILE:b.kt
|
//FILE:b.kt
|
||||||
//+JDK
|
//+JDK
|
||||||
package a.b
|
package b
|
||||||
|
|
||||||
import a.*
|
import a.*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user