Reuse built functional types for postponed arguments by expected types and paths from a top level type variable

^KT-42221 Fixed
This commit is contained in:
Victor Petukhov
2020-10-14 18:02:17 +03:00
parent ee5edf4caa
commit c6da2a1138
18 changed files with 538 additions and 57 deletions
@@ -66,6 +66,8 @@ class KotlinConstraintSystemCompleter(
collectVariablesFromContext: Boolean,
analyze: (PostponedResolvedAtom) -> Unit
) {
val topLevelTypeVariables = topLevelType.extractTypeVariables()
completion@ while (true) {
// TODO
val postponedArguments = getOrderedNotAnalyzedPostponedArguments(topLevelAtoms)
@@ -89,7 +91,11 @@ class KotlinConstraintSystemCompleter(
// Stage 2: collect parameter types for postponed arguments
val wasBuiltNewExpectedTypeForSomeArgument = postponedArgumentInputTypesResolver.collectParameterTypesAndBuildNewExpectedTypes(
asConstraintSystemCompletionContext(), postponedArgumentsWithRevisableType, completionMode, dependencyProvider
asConstraintSystemCompletionContext(),
postponedArgumentsWithRevisableType,
completionMode,
dependencyProvider,
topLevelTypeVariables
)
if (wasBuiltNewExpectedTypeForSomeArgument)