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:
+3
-3
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user