diff --git a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt index 9e73e627277..1e6cd4014fa 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt @@ -406,7 +406,12 @@ class TypeApproximator { } } - newArguments[index] = TypeProjectionImpl(Variance.OUT_VARIANCE, approximatedSuperType) + if (NewKotlinTypeChecker.equalTypes(argumentType, approximatedSuperType)) { + newArguments[index] = approximatedSuperType.asTypeProjection() + } + else { + newArguments[index] = TypeProjectionImpl(Variance.OUT_VARIANCE, approximatedSuperType) + } } } }