Remove deprecated Experimental and UseExperimental annotation classes #KT-53864
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.annotation.AnnotationRetention.BINARY
|
||||
import kotlin.annotation.AnnotationRetention.SOURCE
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
import kotlin.internal.RequireKotlin
|
||||
import kotlin.internal.RequireKotlinVersionKind
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Signals that the annotated annotation class is a marker of an experimental API.
|
||||
*
|
||||
* Any declaration annotated with that marker is considered an experimental declaration
|
||||
* and its call sites should accept the experimental aspect of it either by using [UseExperimental],
|
||||
* or by being annotated with that marker themselves, effectively causing further propagation of that experimental aspect.
|
||||
*
|
||||
* This class is deprecated in favor of a more general approach provided by [RequiresOptIn]/[OptIn].
|
||||
*/
|
||||
@Target(ANNOTATION_CLASS)
|
||||
@Retention(BINARY)
|
||||
@SinceKotlin("1.2")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
|
||||
@Deprecated("Please use RequiresOptIn instead.")
|
||||
public annotation class Experimental(val level: Level = Level.ERROR) {
|
||||
/**
|
||||
* Severity of the diagnostic that should be reported on usages of experimental API which did not explicitly accept the experimental aspect
|
||||
* of that API either by using [UseExperimental] or by being annotated with the corresponding marker annotation.
|
||||
*/
|
||||
public enum class Level {
|
||||
/** Specifies that a warning should be reported on incorrect usages of this experimental API. */
|
||||
WARNING,
|
||||
/** Specifies that an error should be reported on incorrect usages of this experimental API. */
|
||||
ERROR,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to use experimental API denoted by the given markers in the annotated file, declaration, or expression.
|
||||
* If a declaration is annotated with [UseExperimental], its usages are **not** required to opt-in to that experimental API.
|
||||
*
|
||||
* This class is deprecated in favor of a more general approach provided by [RequiresOptIn]/[OptIn].
|
||||
*/
|
||||
@Target(
|
||||
CLASS, PROPERTY, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, EXPRESSION, FILE, TYPEALIAS
|
||||
)
|
||||
@Retention(SOURCE)
|
||||
@SinceKotlin("1.2")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.6")
|
||||
@Deprecated("Please use OptIn instead.", ReplaceWith("OptIn(*markerClass)", "kotlin.OptIn"))
|
||||
public annotation class UseExperimental(
|
||||
vararg val markerClass: KClass<out Annotation>
|
||||
)
|
||||
|
||||
|
||||
@Target(CLASS, PROPERTY, CONSTRUCTOR, FUNCTION, TYPEALIAS)
|
||||
@Retention(BINARY)
|
||||
internal annotation class WasExperimental(
|
||||
vararg val markerClass: KClass<out Annotation>
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin
|
||||
|
||||
import kotlin.annotation.AnnotationRetention.BINARY
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
|
||||
@Target(CLASS, PROPERTY, CONSTRUCTOR, FUNCTION, TYPEALIAS)
|
||||
@Retention(BINARY)
|
||||
internal annotation class WasExperimental(
|
||||
vararg val markerClass: KClass<out Annotation>
|
||||
)
|
||||
Reference in New Issue
Block a user