diff --git a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt index 979aabbb57b..34f4bfe12b5 100644 --- a/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt +++ b/compiler/fir/providers/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt @@ -561,13 +561,14 @@ fun ConeKotlinType.canHaveSubtypes(session: FirSession): Boolean { if (this.isMarkedNullable) { return true } - val classSymbol = toRegularClassSymbol(session) ?: return true + val expandedType = fullyExpandedType(session) + val classSymbol = expandedType.toSymbol(session) as? FirRegularClassSymbol ?: return true if (classSymbol.isEnumClass || classSymbol.isExpect || classSymbol.modality != Modality.FINAL) { return true } classSymbol.typeParameterSymbols.forEachIndexed { idx, typeParameterSymbol -> - val typeProjection = typeArguments[idx] + val typeProjection = expandedType.typeArguments[idx] if (typeProjection.isStarProjection) { return true