Revert "[FE 1.0] Build captured type's supertypes in an alternative way: use own projection type as a first supertype, then supertypes from the corresponding type parameter's upper bounds"

This reverts commit eb19d39cbf.
This commit is contained in:
Denis.Zharkov
2022-08-26 09:13:21 +02:00
committed by teamcity
parent 2a53273f4d
commit 42c41a1916
9 changed files with 14 additions and 83 deletions
@@ -106,8 +106,8 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
val innerType = capturedType.lowerType ?: capturedType.constructor.projection.type.unwrap()
val substitutedInnerType = substitute(innerType, keepAnnotation, runCapturedChecks = false)
val (projectionSupertype, boundSupertypes) =
capturedType.constructor.transformSupertypes { substitute(it, keepAnnotation, runCapturedChecks = false) ?: it }
val substitutedSuperTypes =
capturedType.constructor.supertypes.map { substitute(it, keepAnnotation, runCapturedChecks = false) ?: it }
if (substitutedInnerType != null) {
return if (substitutedInnerType.isCaptured()) substitutedInnerType else {
@@ -116,7 +116,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
NewCapturedTypeConstructor(
TypeProjectionImpl(typeConstructor.projection.projectionKind, substitutedInnerType),
typeParameter = typeConstructor.typeParameter
).also { it.initializeSupertypes(projectionSupertype, boundSupertypes) },
).also { it.initializeSupertypes(substitutedSuperTypes) },
lowerType = if (capturedType.lowerType != null) substitutedInnerType else null
)
}