[NI] Get rid of PostponedArgumentInputTypesResolver.Context
This commit is contained in:
-1
@@ -33,5 +33,4 @@ interface NewConstraintSystem {
|
||||
|
||||
fun asConstraintSystemCompleterContext(): ConstraintSystemCompletionContext
|
||||
fun asPostponedArgumentsAnalyzerContext(): PostponedArgumentsAnalyzerContext
|
||||
fun asPostponedArgumentInputTypesResolverContext(): PostponedArgumentInputTypesResolver.Context
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,5 +30,5 @@ interface ConstraintSystemCompletionContext : VariableFixationFinder.Context, Re
|
||||
|
||||
fun fixVariable(variable: TypeVariableMarker, resultType: KotlinTypeMarker, atom: ResolvedAtom?)
|
||||
|
||||
fun asPostponedArgumentInputTypesResolverContext(): PostponedArgumentInputTypesResolver.Context
|
||||
fun asConstraintSystemCompletionContext(): ConstraintSystemCompletionContext
|
||||
}
|
||||
|
||||
+3
-3
@@ -89,7 +89,7 @@ class KotlinConstraintSystemCompleter(
|
||||
|
||||
// Stage 2: collect parameter types for postponed arguments
|
||||
val wasBuiltNewExpectedTypeForSomeArgument = postponedArgumentInputTypesResolver.collectParameterTypesAndBuildNewExpectedTypes(
|
||||
asPostponedArgumentInputTypesResolverContext(), postponedArgumentsWithRevisableType, completionMode, dependencyProvider
|
||||
asConstraintSystemCompletionContext(), postponedArgumentsWithRevisableType, completionMode, dependencyProvider
|
||||
)
|
||||
|
||||
if (wasBuiltNewExpectedTypeForSomeArgument)
|
||||
@@ -99,7 +99,7 @@ class KotlinConstraintSystemCompleter(
|
||||
// Stage 3: fix variables for parameter types of all postponed arguments
|
||||
for (argument in postponedArguments) {
|
||||
val wasFixedSomeVariable = postponedArgumentInputTypesResolver.fixNextReadyVariableForParameterTypeIfNeeded(
|
||||
asPostponedArgumentInputTypesResolverContext(),
|
||||
asConstraintSystemCompletionContext(),
|
||||
argument,
|
||||
postponedArguments,
|
||||
topLevelType,
|
||||
@@ -114,7 +114,7 @@ class KotlinConstraintSystemCompleter(
|
||||
// Stage 4: create atoms with revised expected types if needed
|
||||
for (argument in postponedArgumentsWithRevisableType) {
|
||||
val wasTransformedSomeArgument = postponedArgumentInputTypesResolver.transformToAtomWithNewFunctionalExpectedType(
|
||||
asPostponedArgumentInputTypesResolverContext(), argument, diagnosticsHolder
|
||||
asConstraintSystemCompletionContext(), argument, diagnosticsHolder
|
||||
)
|
||||
|
||||
if (wasTransformedSomeArgument)
|
||||
|
||||
+2
-2
@@ -16,12 +16,12 @@ import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
private typealias Context = ConstraintSystemCompletionContext
|
||||
|
||||
class PostponedArgumentInputTypesResolver(
|
||||
private val resultTypeResolver: ResultTypeResolver,
|
||||
private val variableFixationFinder: VariableFixationFinder
|
||||
) {
|
||||
interface Context : ConstraintSystemCompletionContext
|
||||
|
||||
private class ParameterTypesInfo(
|
||||
val parametersFromDeclaration: List<UnwrappedType?>?,
|
||||
val parametersFromDeclarationOfRelatedLambdas: Set<List<UnwrappedType?>>?,
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ class NewConstraintSystemImpl(
|
||||
ConstraintInjector.Context,
|
||||
ResultTypeResolver.Context,
|
||||
ConstraintSystemCompletionContext,
|
||||
PostponedArgumentInputTypesResolver.Context,
|
||||
PostponedArgumentsAnalyzerContext {
|
||||
private val storage = MutableConstraintStorage()
|
||||
private var state = State.BUILDING
|
||||
@@ -85,7 +84,7 @@ class NewConstraintSystemImpl(
|
||||
|
||||
override fun asPostponedArgumentsAnalyzerContext() = apply { checkState(State.BUILDING) }
|
||||
|
||||
override fun asPostponedArgumentInputTypesResolverContext() = apply { checkState(State.BUILDING) }
|
||||
override fun asConstraintSystemCompletionContext(): ConstraintSystemCompletionContext = apply { checkState(State.BUILDING) }
|
||||
|
||||
// ConstraintSystemOperation
|
||||
override fun registerVariable(variable: TypeVariableMarker) {
|
||||
|
||||
Reference in New Issue
Block a user