Retention / target for some standard annotations

This commit is contained in:
Mikhail Glukhikh
2015-07-23 11:30:58 +03:00
parent 82165d2a93
commit 8beafe90a0
3 changed files with 10 additions and 7 deletions
+3 -3
View File
@@ -1091,7 +1091,7 @@ public interface Range</*0*/ T : kotlin.Comparable<T>> {
public open fun isEmpty(): kotlin.Boolean public open fun isEmpty(): kotlin.Boolean
} }
kotlin.annotation.annotation() public final class ReplaceWith : kotlin.Annotation { kotlin.annotation.target(allowedTargets = {}) kotlin.annotation.annotation(retention = AnnotationRetention.BINARY) public final class ReplaceWith : kotlin.Annotation {
/*primary*/ public constructor ReplaceWith(/*0*/ expression: kotlin.String, /*1*/ vararg imports: kotlin.String /*kotlin.Array<out kotlin.String>*/) /*primary*/ public constructor ReplaceWith(/*0*/ expression: kotlin.String, /*1*/ vararg imports: kotlin.String /*kotlin.Array<out kotlin.String>*/)
internal final val expression: kotlin.String internal final val expression: kotlin.String
internal final fun <get-expression>(): kotlin.String internal final fun <get-expression>(): kotlin.String
@@ -1293,12 +1293,12 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) ko
/*primary*/ public constructor noinline() /*primary*/ public constructor noinline()
} }
kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.EXPRESSION, AnnotationTarget.FILE}) kotlin.annotation.annotation() public final class suppress : kotlin.Annotation { kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.EXPRESSION, AnnotationTarget.FILE}) kotlin.annotation.annotation(retention = AnnotationRetention.SOURCE) public final class suppress : kotlin.Annotation {
/*primary*/ public constructor suppress(/*0*/ vararg names: kotlin.String /*kotlin.Array<out kotlin.String>*/) /*primary*/ public constructor suppress(/*0*/ vararg names: kotlin.String /*kotlin.Array<out kotlin.String>*/)
internal final val names: kotlin.Array<out kotlin.String> internal final val names: kotlin.Array<out kotlin.String>
internal final fun <get-names>(): kotlin.Array<out kotlin.String> internal final fun <get-names>(): kotlin.Array<out kotlin.String>
} }
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.annotation() public final class tailRecursive : kotlin.Annotation { kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.annotation(retention = AnnotationRetention.SOURCE) public final class tailRecursive : kotlin.Annotation {
/*primary*/ public constructor tailRecursive() /*primary*/ public constructor tailRecursive()
} }
+5 -3
View File
@@ -18,6 +18,7 @@ package kotlin
import kotlin.annotation.* import kotlin.annotation.*
import kotlin.annotation.AnnotationTarget.* import kotlin.annotation.AnnotationTarget.*
import kotlin.annotation.AnnotationRetention.*
/** /**
* Marks the annotated class as a data class. The compiler automatically generates * Marks the annotated class as a data class. The compiler automatically generates
@@ -51,7 +52,8 @@ public annotation class deprecated(val value: String, val replaceWith: ReplaceWi
* @property imports the qualified names that need to be imported in order for the references in the * @property imports the qualified names that need to be imported in order for the references in the
* replacement expression to be resolved correctly. * replacement expression to be resolved correctly.
*/ */
public annotation class ReplaceWith(val expression: String, vararg val imports: String) target()
public annotation(retention = BINARY) class ReplaceWith(val expression: String, vararg val imports: String)
/** /**
* Signifies that the annotated functional type represents an extension function. * Signifies that the annotated functional type represents an extension function.
@@ -65,7 +67,7 @@ public annotation class extension
*/ */
target(CLASSIFIER, ANNOTATION_CLASS, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, target(CLASSIFIER, 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)
public annotation class suppress(vararg val names: String) public annotation(retention = SOURCE) class suppress(vararg val names: String)
/** /**
* Enables the tail call optimization for the annotated function. If the annotated function * Enables the tail call optimization for the annotated function. If the annotated function
@@ -74,4 +76,4 @@ public annotation class suppress(vararg val names: String)
* backend. * backend.
*/ */
target(FUNCTION) target(FUNCTION)
public annotation class tailRecursive public annotation(retention = SOURCE) class tailRecursive
@@ -34,4 +34,5 @@ package kotlin.jvm
* MyList<Int>().add(null) // Error * MyList<Int>().add(null) // Error
* MyList<Int?>().add(null) // Ok * MyList<Int?>().add(null) // Ok
*/ */
public annotation class PurelyImplements(public val value: String) target(AnnotationTarget.CLASSIFIER)
public annotation(retention = AnnotationRetention.RUNTIME) class PurelyImplements(public val value: String)