Annotations on type aliases: add annotation target TYPEALIAS,
use it for @Deprecated and @Suppress.
This commit is contained in:
@@ -26,7 +26,7 @@ import kotlin.annotation.AnnotationTarget.*
|
|||||||
* @property replaceWith if present, specifies a code fragment which should be used as a replacement for
|
* @property replaceWith if present, specifies a code fragment which should be used as a replacement for
|
||||||
* the deprecated API usage.
|
* the deprecated API usage.
|
||||||
*/
|
*/
|
||||||
@Target(CLASS, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER)
|
@Target(CLASS, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER, TYPEALIAS)
|
||||||
@MustBeDocumented
|
@MustBeDocumented
|
||||||
public annotation class Deprecated(
|
public annotation class Deprecated(
|
||||||
val message: String,
|
val message: String,
|
||||||
@@ -84,7 +84,7 @@ public annotation class ParameterName(val name: String)
|
|||||||
* @property names names of the compiler diagnostics to suppress.
|
* @property names names of the compiler diagnostics to suppress.
|
||||||
*/
|
*/
|
||||||
@Target(CLASS, ANNOTATION_CLASS, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER,
|
@Target(CLASS, ANNOTATION_CLASS, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER,
|
||||||
CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, TYPE, EXPRESSION, FILE)
|
CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, TYPE, EXPRESSION, FILE, TYPEALIAS)
|
||||||
@Retention(SOURCE)
|
@Retention(SOURCE)
|
||||||
public annotation class Suppress(vararg val names: String)
|
public annotation class Suppress(vararg val names: String)
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ public enum class AnnotationTarget {
|
|||||||
/** Any expression */
|
/** Any expression */
|
||||||
EXPRESSION,
|
EXPRESSION,
|
||||||
/** File */
|
/** File */
|
||||||
FILE
|
FILE,
|
||||||
|
/** Type alias */
|
||||||
|
TYPEALIAS
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user