Introduce substitution to ConeTypeContext.captureFromArguments
This commit itself does not influence anything
This commit is contained in:
@@ -328,6 +328,10 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
|
|||||||
ConeCapturedType(status, lowerType, argument, typeConstructor.getParameter(index))
|
ConeCapturedType(status, lowerType, argument, typeConstructor.getParameter(index))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val substitutor = substitutorByMap((0 until argumentsCount).map { index ->
|
||||||
|
(typeConstructor.getParameter(index) as ConeTypeParameterLookupTag).toSymbol() to (newArguments[index] as ConeKotlinType)
|
||||||
|
}.toMap())
|
||||||
|
|
||||||
for (index in 0 until argumentsCount) {
|
for (index in 0 until argumentsCount) {
|
||||||
val oldArgument = type.typeArguments[index]
|
val oldArgument = type.typeArguments[index]
|
||||||
val newArgument = newArguments[index]
|
val newArgument = newArguments[index]
|
||||||
@@ -336,7 +340,9 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty
|
|||||||
|
|
||||||
val parameter = typeConstructor.getParameter(index)
|
val parameter = typeConstructor.getParameter(index)
|
||||||
val upperBounds = (0 until parameter.upperBoundCount()).mapTo(mutableListOf()) { paramIndex ->
|
val upperBounds = (0 until parameter.upperBoundCount()).mapTo(mutableListOf()) { paramIndex ->
|
||||||
parameter.getUpperBound(paramIndex) // TODO: substitution
|
substitutor.safeSubstitute(
|
||||||
|
this as TypeSystemInferenceExtensionContext, parameter.getUpperBound(paramIndex)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!oldArgument.isStarProjection() && oldArgument.getVariance() == TypeVariance.OUT) {
|
if (!oldArgument.isStarProjection() && oldArgument.getVariance() == TypeVariance.OUT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user