KT-955 Unable to import a Kotlin package into a Kotlin file with no package header
This commit is contained in:
+6
@@ -585,6 +585,12 @@ public class JavaDescriptorResolver {
|
||||
}
|
||||
|
||||
public NamespaceDescriptor resolveNamespace(String qualifiedName) {
|
||||
// First, let's check that there is no Kotlin package:
|
||||
NamespaceDescriptor kotlinNamespaceDescriptor = semanticServices.getKotlinNamespaceDescriptor(qualifiedName);
|
||||
if (kotlinNamespaceDescriptor != null) {
|
||||
return kotlinNamespaceDescriptor;
|
||||
}
|
||||
|
||||
PsiPackage psiPackage = findPackage(qualifiedName);
|
||||
if (psiPackage == null) {
|
||||
PsiClass psiClass = findClass(qualifiedName);
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//FILE:a.kt
|
||||
//KT-955 Unable to import a Kotlin package into a Kotlin file with no package header
|
||||
//+JDK
|
||||
|
||||
package foo
|
||||
|
||||
fun f() {}
|
||||
|
||||
//FILE:b.kt
|
||||
//+JDK
|
||||
|
||||
import foo.*
|
||||
|
||||
val m = f() // unresolved
|
||||
|
||||
//FILE:c.kt
|
||||
//+JDK
|
||||
|
||||
package java.util
|
||||
|
||||
fun bar() {}
|
||||
|
||||
//FILE:d.kt
|
||||
//+JDK
|
||||
|
||||
import java.util.*
|
||||
|
||||
val r = bar()
|
||||
Reference in New Issue
Block a user