From a61c9a8a4084acbcbab812a2e43f389a45cab334 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Tue, 1 Oct 2019 17:32:44 +0300 Subject: [PATCH] [cadapter][generator] don't let export parametrized functions (KT-34044). --- .../kotlin/backend/konan/CAdapterGenerator.kt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt index 5a37c7cf789..dbff0265866 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt @@ -112,20 +112,12 @@ internal val cKeywords = setOf( "xor_eq" ) -private fun KotlinType.isGeneric() = - constructor.declarationDescriptor is TypeParameterDescriptor - private fun isExportedFunction(descriptor: FunctionDescriptor): Boolean { if (!descriptor.isEffectivelyPublicApi || !descriptor.kind.isReal || descriptor.isExpect) return false if (descriptor.isSuspend) return false - descriptor.allParameters.forEach { - if (it.type.isGeneric()) return false - } - val returnType = descriptor.returnType - if (returnType == null) return true - return !returnType.isGeneric() + return !descriptor.typeParameters.any() } private fun isExportedClass(descriptor: ClassDescriptor): Boolean {