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:
@@ -77,6 +77,7 @@ public class JavaPackageScope extends JetScopeImpl {
|
|||||||
final PsiPackage javaPackage = semanticServices.getDescriptorResolver().findPackage(packageFQN);
|
final PsiPackage javaPackage = semanticServices.getDescriptorResolver().findPackage(packageFQN);
|
||||||
|
|
||||||
if (javaPackage != null) {
|
if (javaPackage != null) {
|
||||||
|
boolean isKotlinNamespace = semanticServices.getKotlinNamespaceDescriptor(javaPackage.getQualifiedName()) != null;
|
||||||
final JavaDescriptorResolver descriptorResolver = semanticServices.getDescriptorResolver();
|
final JavaDescriptorResolver descriptorResolver = semanticServices.getDescriptorResolver();
|
||||||
|
|
||||||
for (PsiPackage psiSubPackage : javaPackage.getSubPackages()) {
|
for (PsiPackage psiSubPackage : javaPackage.getSubPackages()) {
|
||||||
@@ -84,6 +85,8 @@ public class JavaPackageScope extends JetScopeImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (PsiClass psiClass : javaPackage.getClasses()) {
|
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
|
// If this is a Kotlin class, we have already taken it through a containing namespace descriptor
|
||||||
ClassDescriptor kotlinClassDescriptor = semanticServices.getKotlinClassDescriptor(psiClass.getQualifiedName());
|
ClassDescriptor kotlinClassDescriptor = semanticServices.getKotlinClassDescriptor(psiClass.getQualifiedName());
|
||||||
if (kotlinClassDescriptor != null) {
|
if (kotlinClassDescriptor != null) {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
namespace foo
|
||||||
|
|
||||||
open class MySecondClass() {
|
open class MySecondClass() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user