[LL API] Allow multiple candidates for non-local callables (KTIJ-21108)

In a combined classpath, such as scripting classpath for the whole
project, there might be several versions of the same library.
This commit is contained in:
Yan Zhulanow
2023-03-01 00:23:33 +09:00
committed by Space Team
parent d9f023db89
commit 8d1cfe0017
@@ -97,7 +97,7 @@ internal class FirDeclarationForCompiledElementSearcher(private val symbolProvid
val candidates = symbolProvider.findFunctionCandidates(declaration)
val functionCandidate =
candidates
.singleOrNull { KtDeclarationAndFirDeclarationEqualityChecker.representsTheSameDeclaration(declaration, it.fir) }
.firstOrNull { KtDeclarationAndFirDeclarationEqualityChecker.representsTheSameDeclaration(declaration, it.fir) }
?: errorWithFirSpecificEntries("We should be able to find a symbol for function", psi = declaration) {
withCandidates(candidates)
}
@@ -111,7 +111,7 @@ internal class FirDeclarationForCompiledElementSearcher(private val symbolProvid
val candidates = symbolProvider.findPropertyCandidates(declaration)
val propertyCandidate =
candidates.singleOrNull { KtDeclarationAndFirDeclarationEqualityChecker.representsTheSameDeclaration(declaration, it.fir) }
candidates.firstOrNull { KtDeclarationAndFirDeclarationEqualityChecker.representsTheSameDeclaration(declaration, it.fir) }
?: errorWithFirSpecificEntries("We should be able to find a symbol for property", psi = declaration) {
withCandidates(candidates)
}