[NI] Fix CST calculation for covariant type projections
This commit is contained in:
+2
-1
@@ -388,7 +388,8 @@ object NewCommonSuperTypeCalculator {
|
||||
return if (equalToEachOtherType == null) {
|
||||
createTypeArgument(commonSuperType(argumentTypes, depth + 1), TypeVariance.OUT)
|
||||
} else {
|
||||
createTypeArgument(equalToEachOtherType.getType(), TypeVariance.INV)
|
||||
val thereIsNotInv = arguments.any { it.getVariance() != TypeVariance.INV }
|
||||
createTypeArgument(equalToEachOtherType.getType(), if (thereIsNotInv) TypeVariance.OUT else TypeVariance.INV)
|
||||
}
|
||||
} else {
|
||||
val type = intersectTypes(arguments.map { it.getType() })
|
||||
|
||||
Reference in New Issue
Block a user