1. namespace class should not be accessible from Kotlin despite the fact we don't have kotlin class descriptor for it.

2. testdata is corrected due to the fact frontend has wrong qualified name in trace for root namespace
This commit is contained in:
Maxim Shafirov
2011-12-13 16:15:43 +04:00
parent 9d0a2c7243
commit c4fd2e564f
2 changed files with 6 additions and 1 deletions
@@ -77,6 +77,7 @@ public class JavaPackageScope extends JetScopeImpl {
final PsiPackage javaPackage = semanticServices.getDescriptorResolver().findPackage(packageFQN);
if (javaPackage != null) {
boolean isKotlinNamespace = semanticServices.getKotlinNamespaceDescriptor(javaPackage.getQualifiedName()) != null;
final JavaDescriptorResolver descriptorResolver = semanticServices.getDescriptorResolver();
for (PsiPackage psiSubPackage : javaPackage.getSubPackages()) {
@@ -84,6 +85,8 @@ public class JavaPackageScope extends JetScopeImpl {
}
for (PsiClass psiClass : javaPackage.getClasses()) {
if (isKotlinNamespace && "namespace".equals(psiClass.getName())) continue;
// If this is a Kotlin class, we have already taken it through a containing namespace descriptor
ClassDescriptor kotlinClassDescriptor = semanticServices.getKotlinClassDescriptor(psiClass.getQualifiedName());
if (kotlinClassDescriptor != null) {