[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:
+2
-2
@@ -97,7 +97,7 @@ internal class FirDeclarationForCompiledElementSearcher(private val symbolProvid
|
|||||||
val candidates = symbolProvider.findFunctionCandidates(declaration)
|
val candidates = symbolProvider.findFunctionCandidates(declaration)
|
||||||
val functionCandidate =
|
val functionCandidate =
|
||||||
candidates
|
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) {
|
?: errorWithFirSpecificEntries("We should be able to find a symbol for function", psi = declaration) {
|
||||||
withCandidates(candidates)
|
withCandidates(candidates)
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ internal class FirDeclarationForCompiledElementSearcher(private val symbolProvid
|
|||||||
|
|
||||||
val candidates = symbolProvider.findPropertyCandidates(declaration)
|
val candidates = symbolProvider.findPropertyCandidates(declaration)
|
||||||
val propertyCandidate =
|
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) {
|
?: errorWithFirSpecificEntries("We should be able to find a symbol for property", psi = declaration) {
|
||||||
withCandidates(candidates)
|
withCandidates(candidates)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user