From 0d53e118517b309488efc565cf71022e78d1af4c Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Sat, 25 Mar 2023 23:20:19 +0200 Subject: [PATCH] [K/N] Internalize all annotations in kotlin.native.internal package As a part of efforts to stabilize Native stdlib #KT-55765. --- .../backend.native/tests/runtime/memory/var1.kt | 1 + .../kotlin/kotlin/native/internal/Annotations.kt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/kotlin-native/backend.native/tests/runtime/memory/var1.kt b/kotlin-native/backend.native/tests/runtime/memory/var1.kt index 774c02f8d91..2d4b2581175 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/var1.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/var1.kt @@ -33,6 +33,7 @@ fun Any?.use() { var x = this } +@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @kotlin.native.internal.CanBePrecreated object CompileTime { diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt index 153e461386d..60c476f4574 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt @@ -22,7 +22,8 @@ package kotlin.native.internal AnnotationTarget.PROPERTY_SETTER ) @Retention(AnnotationRetention.BINARY) -public annotation class ExportForCppRuntime(val name: String = "") +@PublishedApi +internal annotation class ExportForCppRuntime(val name: String = "") /** * This annotation denotes that the element is intrinsic and its usages require special handling in compiler. @@ -38,7 +39,8 @@ internal annotation class Intrinsic */ @Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.CLASS) @Retention(AnnotationRetention.BINARY) -public annotation class ExportForCompiler +@PublishedApi +internal annotation class ExportForCompiler /** * Class is frozen by default. Also this annotation is (ab)used for marking objects @@ -69,7 +71,8 @@ internal annotation class NoReorderFields */ @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.BINARY) -public annotation class ExportTypeInfo(val name: String) +@PublishedApi +internal annotation class ExportTypeInfo(val name: String) /** * If a lambda shall be carefully lowered by the compiler. @@ -119,7 +122,8 @@ internal annotation class ConstantConstructorIntrinsic(val kind: String) */ @Target(AnnotationTarget.FUNCTION) @Retention(AnnotationRetention.BINARY) -annotation class Independent +@PublishedApi +internal annotation class Independent /** * Indicates that `@SymbolName external` function can throw foreign exception to be filtered on callsite. @@ -144,7 +148,8 @@ annotation class Independent */ @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.SOURCE) -public annotation class CanBePrecreated +@PublishedApi +internal annotation class CanBePrecreated /** * Marks a class that has a finalizer.