From c9e9cbb62d1896338a490fb1f060735f340874ef Mon Sep 17 00:00:00 2001 From: Pavel Kunyavskiy Date: Thu, 16 Dec 2021 11:35:03 +0300 Subject: [PATCH] [K/N] Fix vtable generation for nested suspend function inheritance ^KT-50304 --- .../common/lower/AbstractSuspendFunctionsLowering.kt | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) 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