From e3a253f50844c1419111bec4648ade3838a7a383 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Fri, 7 Apr 2017 00:05:55 +0300 Subject: [PATCH] Treat `internal` names with `@PublishedApi` annotation as exported. --- .../jetbrains/kotlin/backend/konan/llvm/BinaryInterface.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/BinaryInterface.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/BinaryInterface.kt index 347fe572513..233d52c01b9 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/BinaryInterface.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/BinaryInterface.kt @@ -54,6 +54,9 @@ internal tailrec fun DeclarationDescriptor.isExported(): Boolean { if (this.annotations.hasAnnotation(exportForCompilerAnnotation)){ return true } + if (this.annotations.hasAnnotation(publishedApiAnnotation)){ + return true + } if (this is ConstructorDescriptor && constructedClass.kind.isSingleton) { @@ -82,6 +85,8 @@ private val exportForCppRuntimeAnnotation = FqName("konan.internal.ExportForCppR private val exportForCompilerAnnotation = FqName("konan.internal.ExportForCompiler") +private val publishedApiAnnotation = FqName("kotlin.PublishedApi") + private fun acyclicTypeMangler(visited: MutableSet, type: KotlinType): String { val descriptor = TypeUtils.getTypeParameterDescriptorOrNull(type) if (descriptor != null) {