[FE] Substitute erased type parameters as covariant

This commit is contained in:
Victor Petukhov
2022-04-25 18:59:52 +03:00
committed by teamcity
parent 4293b546ba
commit 54f0794ce3
8 changed files with 52 additions and 3 deletions
@@ -716,7 +716,9 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
)
val typeParameters = this.extractTypeParameters()
.map { it as TypeParameterDescriptor }
.associateWith { TypeProjectionImpl(eraser.getErasedUpperBound(it, ErasureTypeAttributes(TypeUsage.COMMON))) }
.associateWith {
TypeProjectionImpl(Variance.OUT_VARIANCE, eraser.getErasedUpperBound(it, ErasureTypeAttributes(TypeUsage.COMMON)))
}
return TypeConstructorSubstitution.createByParametersMap(typeParameters).buildSubstitutor().safeSubstitute(this)
}