EA-218474: fix IAE in resolving empty fqName in new J2K

This commit is contained in:
Ilya Kirillov
2019-12-05 18:22:56 +03:00
parent af5a70dcf5
commit b7711678c2
@@ -71,13 +71,15 @@ class JKResolver(val project: Project, module: Module?, private val contextEleme
KotlinTopLevelPropertyFqnNameIndex.getInstance()[fqName.asString(), project, scope].firstOrNull()
private fun resolveFqName(fqName: FqName): PsiElement? =
constructImportDirectiveWithContext(fqName)
private fun resolveFqName(fqName: FqName): PsiElement? {
if (fqName.isRoot) return null
return constructImportDirectiveWithContext(fqName)
.getChildOfType<KtDotQualifiedExpression>()
?.selectorExpression
?.let {
it.references.mapNotNull { it.resolve() }.firstOrNull()
}
}
private fun constructImportDirectiveWithContext(fqName: FqName): KtImportDirective {