[FE 1.0] Don't mark type variable as READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES if it has complex dependency to other type variables

^KT-49838 Fixed
This commit is contained in:
Victor Petukhov
2021-11-30 18:07:48 +03:00
parent 61d40403e7
commit ce2c6f5d1f
10 changed files with 80 additions and 1 deletions
@@ -67,7 +67,7 @@ class VariableFixationFinder(
): TypeVariableFixationReadiness = when {
!notFixedTypeVariables.contains(variable) ||
dependencyProvider.isVariableRelatedToTopLevelType(variable) -> TypeVariableFixationReadiness.FORBIDDEN
isTypeInferenceForSelfTypesSupported && hasOnlyDeclaredUpperBoundSelfTypes(variable) ->
isTypeInferenceForSelfTypesSupported && hasOnlyDeclaredUpperBoundSelfTypes(variable) && !hasDependencyToOtherTypeVariables(variable) ->
TypeVariableFixationReadiness.READY_FOR_FIXATION_DECLARED_UPPER_BOUND_WITH_SELF_TYPES
!variableHasProperArgumentConstraints(variable) -> TypeVariableFixationReadiness.WITHOUT_PROPER_ARGUMENT_CONSTRAINT
hasDependencyToOtherTypeVariables(variable) -> TypeVariableFixationReadiness.WITH_COMPLEX_DEPENDENCY