Rollback parameter descriptor propagation to CapturedTypeConstructor
This commit is contained in:
+1
-1
@@ -320,7 +320,7 @@ class ConstraintSystemBuilderImpl : ConstraintSystem.Builder {
|
||||
else {
|
||||
constrainingTypeProjection
|
||||
}
|
||||
val capturedType = createCapturedType(typeProjection, typeVariable.originalTypeParameter)
|
||||
val capturedType = createCapturedType(typeProjection)
|
||||
addBound(typeVariable, capturedType, EXACT_BOUND, constraintContext)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -87,8 +87,8 @@ private fun ConstraintSystemBuilderImpl.generateNewBound(bound: Bound, substitut
|
||||
|
||||
val substitutedType = when (substitution.kind) {
|
||||
EXACT_BOUND -> substitution.constrainingType
|
||||
UPPER_BOUND -> CapturedType(TypeProjectionImpl(Variance.OUT_VARIANCE, substitution.constrainingType), substitution.typeVariable.originalTypeParameter)
|
||||
LOWER_BOUND -> CapturedType(TypeProjectionImpl(Variance.IN_VARIANCE, substitution.constrainingType), substitution.typeVariable.originalTypeParameter)
|
||||
UPPER_BOUND -> CapturedType(TypeProjectionImpl(Variance.OUT_VARIANCE, substitution.constrainingType))
|
||||
LOWER_BOUND -> CapturedType(TypeProjectionImpl(Variance.IN_VARIANCE, substitution.constrainingType))
|
||||
}
|
||||
|
||||
val newTypeProjection = TypeProjectionImpl(substitutedType)
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ class CapturedTypeApproximationTest() : KotlinLiteFixture() {
|
||||
fun createTestSubstitutor(testSubstitution: Map<TypeParameterDescriptor, TypeProjection>): TypeSubstitutor {
|
||||
val substitutionContext = testSubstitution.map {
|
||||
val (typeParameter, typeProjection) = it
|
||||
typeParameter.typeConstructor to TypeProjectionImpl(createCapturedType(typeProjection, typeParameter))
|
||||
typeParameter.typeConstructor to TypeProjectionImpl(createCapturedType(typeProjection))
|
||||
}.toMap()
|
||||
return TypeSubstitutor.create(substitutionContext)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user