[NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
This commit is contained in:
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.createLookupLocation
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getCall
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.isSafeCall
|
||||
import org.jetbrains.kotlin.resolve.calls.components.CallableReferenceResolver
|
||||
import org.jetbrains.kotlin.resolve.calls.components.InferenceSession
|
||||
import org.jetbrains.kotlin.resolve.calls.components.PostponedArgumentsAnalyzer
|
||||
import org.jetbrains.kotlin.resolve.calls.context.BasicCallResolutionContext
|
||||
@@ -67,7 +68,8 @@ class PSICallResolver(
|
||||
private val postponedArgumentsAnalyzer: PostponedArgumentsAnalyzer,
|
||||
private val kotlinConstraintSystemCompleter: KotlinConstraintSystemCompleter,
|
||||
private val deprecationResolver: DeprecationResolver,
|
||||
private val moduleDescriptor: ModuleDescriptor
|
||||
private val moduleDescriptor: ModuleDescriptor,
|
||||
private val callableReferenceResolver: CallableReferenceResolver
|
||||
) {
|
||||
private val givenCandidatesName = Name.special("<given candidates>")
|
||||
|
||||
@@ -389,7 +391,9 @@ class PSICallResolver(
|
||||
override fun factoryForVariable(stripExplicitReceiver: Boolean): CandidateFactory<KotlinResolutionCandidate> {
|
||||
val explicitReceiver = if (stripExplicitReceiver) null else kotlinCall.explicitReceiver
|
||||
val variableCall = PSIKotlinCallForVariable(kotlinCall, explicitReceiver, kotlinCall.name)
|
||||
return SimpleCandidateFactory(callComponents, scopeTower, variableCall, createResolutionCallbacks(context))
|
||||
return SimpleCandidateFactory(
|
||||
callComponents, scopeTower, variableCall, createResolutionCallbacks(context), callableReferenceResolver
|
||||
)
|
||||
}
|
||||
|
||||
override fun factoryForInvoke(variable: KotlinResolutionCandidate, useExplicitReceiver: Boolean):
|
||||
@@ -410,7 +414,7 @@ class PSICallResolver(
|
||||
}
|
||||
|
||||
return variableCallArgument.receiver to SimpleCandidateFactory(
|
||||
callComponents, scopeTower, callForInvoke, createResolutionCallbacks(context)
|
||||
callComponents, scopeTower, callForInvoke, createResolutionCallbacks(context), callableReferenceResolver
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user