[FIR] Add checker for EXPANSIVE_INHERITANCE

^KT-59402 Fixed
This commit is contained in:
Brian Norman
2023-10-20 15:10:28 -05:00
committed by Space Team
parent a991a13295
commit e9983a947f
19 changed files with 266 additions and 68 deletions
@@ -53,6 +53,14 @@ private fun ConeKotlinType.contains(predicate: (ConeKotlinType) -> Boolean, visi
// ----------------------------------- Transformations -----------------------------------
fun ConeKotlinType.unwrapLowerBound(): ConeSimpleKotlinType {
return when(this) {
is ConeDefinitelyNotNullType -> original.unwrapLowerBound()
is ConeFlexibleType -> lowerBound.unwrapLowerBound()
is ConeSimpleKotlinType -> this
}
}
fun ConeKotlinType.upperBoundIfFlexible(): ConeSimpleKotlinType {
return when (this) {
is ConeSimpleKotlinType -> this