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
@@ -86,14 +86,13 @@ private fun ClassId.mutableToReadOnly(): ClassId? {
return JavaToKotlinClassMap.mutableToReadOnly(this)
}
private fun ConeKotlinType.enhanceInflexibleType(
private fun ConeSimpleKotlinType.enhanceInflexibleType(
session: FirSession,
position: TypeComponentPosition,
qualifiers: IndexedJavaTypeQualifiers,
index: Int,
subtreeSizes: List<Int>,
): ConeKotlinType? {
require(this !is ConeFlexibleType) { "$this should not be flexible" }
): ConeSimpleKotlinType? {
val shouldEnhance = position.shouldEnhance()
if ((!shouldEnhance && typeArguments.isEmpty()) || this !is ConeLookupTagBasedType) {
return null