diff --git a/libraries/stdlib/src/kotlin/annotations/ExperimentalStdlibApi.kt b/libraries/stdlib/src/kotlin/annotations/ExperimentalStdlibApi.kt new file mode 100644 index 00000000000..325d915cc69 --- /dev/null +++ b/libraries/stdlib/src/kotlin/annotations/ExperimentalStdlibApi.kt @@ -0,0 +1,34 @@ +package kotlin + +import kotlin.annotation.AnnotationTarget.* + +/** + * The experimental standard library API marker. The API marked with this annotation is not subject to the + * [general compatibility guarantees](https://kotlinlang.org/docs/reference/evolution/components-stability.html) given for the standard library: + * the behavior of such API may be changed or the API may be removed completely in any further release. + * + * > Beware using the annotated API especially if you're developing a library, since your library might become binary incompatible + * with the future versions of the standard library. + * + * Any usage of a declaration annotated with `@ExperimentalStdlibApi` must be accepted either by + * annotating that usage with the [UseExperimental] annotation, e.g. `@UseExperimental(ExperimentalStdlibApi::class)`, + * or by using the compiler argument `-Xuse-experimental=kotlin.ExperimentalStdlibApi`. + */ +@Experimental(level = Experimental.Level.ERROR) +@Retention(AnnotationRetention.BINARY) +@Target( + CLASS, + ANNOTATION_CLASS, + PROPERTY, + FIELD, + LOCAL_VARIABLE, + VALUE_PARAMETER, + CONSTRUCTOR, + FUNCTION, + PROPERTY_GETTER, + PROPERTY_SETTER, + TYPEALIAS +) +@ExperimentalStdlibApi +@SinceKotlin("1.3") // TODO: Remove experimental status from itself and advance SinceKotlin to 1.4 +public annotation class ExperimentalStdlibApi diff --git a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt index 0956eb76ab2..99b5083a71c 100644 --- a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt +++ b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt @@ -37,6 +37,9 @@ public final class kotlin/Experimental$Level : java/lang/Enum { public abstract interface annotation class kotlin/ExperimentalMultiplatform : java/lang/annotation/Annotation { } +public abstract interface annotation class kotlin/ExperimentalStdlibApi : java/lang/annotation/Annotation { +} + public abstract interface annotation class kotlin/ExperimentalUnsignedTypes : java/lang/annotation/Annotation { }