[FE 1.0] Rename ManyCandidatesResolver to StubTypesBasedInferenceSession

This commit is contained in:
Victor Petukhov
2021-12-24 12:43:56 +03:00
committed by teamcity
parent c1d3f7e5b4
commit ab207ca58f
3 changed files with 8 additions and 8 deletions
@@ -19,7 +19,7 @@ import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintS
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
import org.jetbrains.kotlin.resolve.calls.inference.model.DelegatedPropertyConstraintPositionImpl import org.jetbrains.kotlin.resolve.calls.inference.model.DelegatedPropertyConstraintPositionImpl
import org.jetbrains.kotlin.resolve.calls.model.* import org.jetbrains.kotlin.resolve.calls.model.*
import org.jetbrains.kotlin.resolve.calls.tower.ManyCandidatesResolver import org.jetbrains.kotlin.resolve.calls.tower.StubTypesBasedInferenceSession
import org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver import org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver
import org.jetbrains.kotlin.resolve.calls.tower.PSIPartialCallInfo import org.jetbrains.kotlin.resolve.calls.tower.PSIPartialCallInfo
import org.jetbrains.kotlin.types.ErrorUtils import org.jetbrains.kotlin.types.ErrorUtils
@@ -36,11 +36,11 @@ class DelegatedPropertyInferenceSession(
callComponents: KotlinCallComponents, callComponents: KotlinCallComponents,
builtIns: KotlinBuiltIns, builtIns: KotlinBuiltIns,
override val parentSession: InferenceSession? override val parentSession: InferenceSession?
) : ManyCandidatesResolver<FunctionDescriptor>( ) : StubTypesBasedInferenceSession<FunctionDescriptor>(
psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns
) { ) {
init { init {
if (parentSession is ManyCandidatesResolver<*>) { if (parentSession is StubTypesBasedInferenceSession<*>) {
parentSession.addNestedInferenceSession(this) parentSession.addNestedInferenceSession(this)
} }
} }
@@ -57,14 +57,14 @@ class BuilderInferenceSession(
private val typeApproximator: TypeApproximator, private val typeApproximator: TypeApproximator,
private val missingSupertypesResolver: MissingSupertypesResolver, private val missingSupertypesResolver: MissingSupertypesResolver,
private val lambdaArgument: LambdaKotlinCallArgument private val lambdaArgument: LambdaKotlinCallArgument
) : ManyCandidatesResolver<CallableDescriptor>( ) : StubTypesBasedInferenceSession<CallableDescriptor>(
psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns psiCallResolver, postponedArgumentsAnalyzer, kotlinConstraintSystemCompleter, callComponents, builtIns
) { ) {
private lateinit var lambda: ResolvedLambdaAtom private lateinit var lambda: ResolvedLambdaAtom
private val commonSystem = NewConstraintSystemImpl(callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner) private val commonSystem = NewConstraintSystemImpl(callComponents.constraintInjector, builtIns, callComponents.kotlinTypeRefiner)
init { init {
if (topLevelCallContext.inferenceSession is ManyCandidatesResolver<*>) { if (topLevelCallContext.inferenceSession is StubTypesBasedInferenceSession<*>) {
topLevelCallContext.inferenceSession.addNestedInferenceSession(this) topLevelCallContext.inferenceSession.addNestedInferenceSession(this)
} }
stubsForPostponedVariables.keys.forEach(commonSystem::registerVariable) stubsForPostponedVariables.keys.forEach(commonSystem::registerVariable)
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
import org.jetbrains.kotlin.types.TypeConstructor import org.jetbrains.kotlin.types.TypeConstructor
abstract class ManyCandidatesResolver<D : CallableDescriptor>( abstract class StubTypesBasedInferenceSession<D : CallableDescriptor>(
private val psiCallResolver: PSICallResolver, private val psiCallResolver: PSICallResolver,
private val postponedArgumentsAnalyzer: PostponedArgumentsAnalyzer, private val postponedArgumentsAnalyzer: PostponedArgumentsAnalyzer,
protected val kotlinConstraintSystemCompleter: KotlinConstraintSystemCompleter, protected val kotlinConstraintSystemCompleter: KotlinConstraintSystemCompleter,
@@ -31,9 +31,9 @@ abstract class ManyCandidatesResolver<D : CallableDescriptor>(
protected val partiallyResolvedCallsInfo = arrayListOf<PSIPartialCallInfo>() protected val partiallyResolvedCallsInfo = arrayListOf<PSIPartialCallInfo>()
private val errorCallsInfo = arrayListOf<PSIErrorCallInfo<D>>() private val errorCallsInfo = arrayListOf<PSIErrorCallInfo<D>>()
private val completedCalls = hashSetOf<ResolvedAtom>() private val completedCalls = hashSetOf<ResolvedAtom>()
protected val nestedInferenceSessions = hashSetOf<ManyCandidatesResolver<*>>() protected val nestedInferenceSessions = hashSetOf<StubTypesBasedInferenceSession<*>>()
fun addNestedInferenceSession(inferenceSession: ManyCandidatesResolver<*>) { fun addNestedInferenceSession(inferenceSession: StubTypesBasedInferenceSession<*>) {
nestedInferenceSessions.add(inferenceSession) nestedInferenceSessions.add(inferenceSession)
} }