ConeFlexibleType: statically require to have simple bounds

This commit is contained in:
Mikhail Glukhikh
2021-12-03 13:36:09 +03:00
parent fa8441fb23
commit 2ba2453062
9 changed files with 76 additions and 45 deletions
@@ -132,6 +132,12 @@ object FirJavaGenericVarianceViolationTypeChecker : FirFunctionCallChecker() {
lowerBound.removeOutProjection(isCovariant),
upperBound.removeOutProjection(isCovariant)
)
is ConeSimpleKotlinType -> removeOutProjection(isCovariant)
}
}
private fun ConeSimpleKotlinType.removeOutProjection(isCovariant: Boolean): ConeSimpleKotlinType {
return when (this) {
is ConeCapturedType -> ConeCapturedType(
captureStatus,
lowerType?.removeOutProjection(isCovariant),