diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt index 2035c65b3a0..2f953533beb 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AbstractSuspendFunctionsLowering.kt @@ -72,17 +72,7 @@ abstract class AbstractSuspendFunctionsLowering(val co } private fun addMissingSupertypes(clazz: IrClass) { - val suspendFunctionTypes = mutableSetOf() - for (superType in getAllSubstitutedSupertypes(clazz)) { - when { - superType.isFunctionMarker() -> Unit // Proceed with others. - superType.isFunction() -> { - // Mixing suspend and non-suspend function supertypes is not allowed by the frontend. So can stop here. - return - } - superType.isSuspendFunction() -> suspendFunctionTypes += superType - } - } + val suspendFunctionTypes = getAllSubstitutedSupertypes(clazz).filter { it.isSuspendFunction() }.toSet() for (suspendFunctionType in suspendFunctionTypes) { val suspendFunctionClassSymbol = suspendFunctionType.classOrNull ?: continue