diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 4b1b1d9933e..3452f73d152 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1091,7 +1091,7 @@ public interface Range> { public open fun isEmpty(): kotlin.Boolean } -kotlin.annotation.target(allowedTargets = {}) kotlin.annotation.annotation(retention = AnnotationRetention.BINARY) public final class ReplaceWith : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.BINARY) public final class ReplaceWith : kotlin.Annotation { /*primary*/ public constructor ReplaceWith(/*0*/ expression: kotlin.String, /*1*/ vararg imports: kotlin.String /*kotlin.Array*/) internal final val expression: kotlin.String internal final fun (): kotlin.String @@ -1261,11 +1261,11 @@ public object Unit { /*primary*/ private constructor Unit() } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.annotation.annotation() public final class data : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.annotation.annotation(mustBeDocumented = true) public final class data : kotlin.Annotation { /*primary*/ public constructor data() } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation() public final class deprecated : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true) public final class deprecated : kotlin.Annotation { /*primary*/ public constructor deprecated(/*0*/ value: kotlin.String, /*1*/ replaceWith: kotlin.ReplaceWith = ...) internal final val replaceWith: kotlin.ReplaceWith internal final fun (): kotlin.ReplaceWith @@ -1273,23 +1273,23 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER, Annotati internal final fun (): kotlin.String } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annotation.annotation() public final class extension : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annotation.annotation(mustBeDocumented = true) public final class extension : kotlin.Annotation { /*primary*/ public constructor extension() } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(retention = AnnotationRetention.RUNTIME) public final class inline : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class inline : kotlin.Annotation { /*primary*/ public constructor inline(/*0*/ strategy: kotlin.InlineStrategy = ...) public final val strategy: kotlin.InlineStrategy public final fun (): kotlin.InlineStrategy } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(retention = AnnotationRetention.RUNTIME) public final class inlineOptions : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class inlineOptions : kotlin.Annotation { /*primary*/ public constructor inlineOptions(/*0*/ vararg value: kotlin.InlineOption /*kotlin.Array*/) internal final val value: kotlin.Array internal final fun (): kotlin.Array } -kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(retention = AnnotationRetention.RUNTIME) public final class noinline : kotlin.Annotation { +kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class noinline : kotlin.Annotation { /*primary*/ public constructor noinline() } diff --git a/core/builtins/src/kotlin/Annotations.kt b/core/builtins/src/kotlin/Annotations.kt index cf338fcf4a0..789b8aeeb71 100644 --- a/core/builtins/src/kotlin/Annotations.kt +++ b/core/builtins/src/kotlin/Annotations.kt @@ -27,7 +27,7 @@ import kotlin.annotation.AnnotationRetention.* * for more information. */ target(CLASSIFIER) -public annotation class data +public annotation(mustBeDocumented = true) class data /** * Marks the annotated class, function, property, variable or parameter as deprecated. @@ -37,7 +37,7 @@ public annotation class data */ target(CLASSIFIER, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER, LOCAL_VARIABLE, FIELD, VALUE_PARAMETER) -public annotation class deprecated(val value: String, val replaceWith: ReplaceWith = ReplaceWith("")) +public annotation(mustBeDocumented = true) class deprecated(val value: String, val replaceWith: ReplaceWith = ReplaceWith("")) /** * Specifies a code fragment that can be used to replace a deprecated function or property. Tools such @@ -53,13 +53,13 @@ public annotation class deprecated(val value: String, val replaceWith: ReplaceWi * replacement expression to be resolved correctly. */ target() -public annotation(retention = BINARY) class ReplaceWith(val expression: String, vararg val imports: String) +public annotation(retention = BINARY, mustBeDocumented = true) class ReplaceWith(val expression: String, vararg val imports: String) /** * Signifies that the annotated functional type represents an extension function. */ target(TYPE) -public annotation class extension +public annotation(mustBeDocumented = true) class extension /** * Suppresses the given compilation warnings in the annotated element. diff --git a/core/builtins/src/kotlin/Inline.kt b/core/builtins/src/kotlin/Inline.kt index 97b4a3c2468..dfefa0e8124 100644 --- a/core/builtins/src/kotlin/Inline.kt +++ b/core/builtins/src/kotlin/Inline.kt @@ -21,7 +21,7 @@ package kotlin * function literals passed as arguments for this parameter. */ target(AnnotationTarget.VALUE_PARAMETER) -public annotation(retention = AnnotationRetention.RUNTIME) class noinline +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class noinline /** * Enables inlining of the annotated function and the function literals that it takes as parameters into the @@ -35,7 +35,7 @@ public annotation(retention = AnnotationRetention.RUNTIME) class noinline * @see inlineOptions */ target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) -public annotation(retention = AnnotationRetention.RUNTIME) class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION) +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION) /** * Specifies the strategy for code generation for an inline function. @@ -64,7 +64,7 @@ public enum class InlineStrategy { * @property value the inlining options selected for the annotated function parameter. */ target(AnnotationTarget.VALUE_PARAMETER) -public annotation(retention = AnnotationRetention.RUNTIME) class inlineOptions(vararg val value: InlineOption) +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class inlineOptions(vararg val value: InlineOption) /** * Specifies the control flow statements which are allowed to be used for non-local control flow transfer in a lambda diff --git a/core/builtins/src/kotlin/annotation/Annotations.kt b/core/builtins/src/kotlin/annotation/Annotations.kt index 876621e617f..80d822184fd 100644 --- a/core/builtins/src/kotlin/annotation/Annotations.kt +++ b/core/builtins/src/kotlin/annotation/Annotations.kt @@ -75,7 +75,7 @@ public enum class AnnotationRetention { * @property allowedTargets list of allowed annotation targets */ target(AnnotationTarget.ANNOTATION_CLASS) -public annotation class target(vararg val allowedTargets: AnnotationTarget) +public annotation(mustBeDocumented = true) class target(vararg val allowedTargets: AnnotationTarget) /** * This special meta-annotation is used to declare an annotation and to set its base properties. @@ -86,7 +86,7 @@ public annotation class target(vararg val allowedTargets: AnnotationTarget) * @property mustBeDocumented true if annotation is a part of public API and therefore must be documented, otherwise false (default) */ target(AnnotationTarget.ANNOTATION_CLASS) -public annotation(retention = AnnotationRetention.SOURCE) class annotation ( +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class annotation ( val retention: AnnotationRetention = AnnotationRetention.RUNTIME, val repeatable: Boolean = false, val mustBeDocumented: Boolean = false diff --git a/core/runtime.jvm/src/kotlin/jvm/PurelyImplements.kt b/core/runtime.jvm/src/kotlin/jvm/PurelyImplements.kt index d70d8fa2f43..c4c78666f59 100644 --- a/core/runtime.jvm/src/kotlin/jvm/PurelyImplements.kt +++ b/core/runtime.jvm/src/kotlin/jvm/PurelyImplements.kt @@ -35,4 +35,4 @@ package kotlin.jvm * MyList().add(null) // Ok */ target(AnnotationTarget.CLASSIFIER) -public annotation(retention = AnnotationRetention.RUNTIME) class PurelyImplements(public val value: String) +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class PurelyImplements(public val value: String) diff --git a/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt b/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt index 7353ee2edd1..5d56db38898 100644 --- a/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt +++ b/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt @@ -23,14 +23,14 @@ import kotlin.annotation.AnnotationTarget.* * are immediately made visible to other threads. */ target(PROPERTY, FIELD) -public annotation(retention = AnnotationRetention.SOURCE) class volatile +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class volatile /** * Marks the JVM backing field of the annotated property as `transient`, meaning that it is not * part of the default serialized form of the object. */ target(PROPERTY, FIELD) -public annotation(retention = AnnotationRetention.SOURCE) class transient +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class transient /** * Marks the JVM method generated from the annotated function as `strictfp`, meaning that the precision @@ -38,7 +38,7 @@ public annotation(retention = AnnotationRetention.SOURCE) class transient * achieve better portability. */ target(FUNCTION, CONSTRUCTOR, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, CLASSIFIER) -public annotation(retention = AnnotationRetention.SOURCE) class strictfp +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class strictfp /** * Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method @@ -46,11 +46,11 @@ public annotation(retention = AnnotationRetention.SOURCE) class strictfp * for static methods, the class) on which the method is defined. */ target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) -public annotation(retention = AnnotationRetention.SOURCE) class synchronized +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class synchronized /** * Marks the JVM method generated from the annotated function as `native`, meaning that it's not implemented * in Java but rather in a different language (for example, in C/C++ using JNI). */ target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) -public annotation(retention = AnnotationRetention.SOURCE) class native +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class native diff --git a/libraries/stdlib/src/kotlin/jvm/JvmPlatformAnnotations.kt b/libraries/stdlib/src/kotlin/jvm/JvmPlatformAnnotations.kt index 1fe811bd3c9..7e2f102a56b 100644 --- a/libraries/stdlib/src/kotlin/jvm/JvmPlatformAnnotations.kt +++ b/libraries/stdlib/src/kotlin/jvm/JvmPlatformAnnotations.kt @@ -23,10 +23,10 @@ package kotlin.jvm * takes N-1 parameters (all but the last one that takes a default value), the second takes N-2 parameters, and so on. */ target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR) -public annotation(retention = AnnotationRetention.BINARY) class jvmOverloads +public annotation(retention = AnnotationRetention.BINARY, mustBeDocumented = true) class jvmOverloads /** * Instructs the Kotlin compiler to generate a public backing field for this property. */ target(AnnotationTarget.PROPERTY) -public annotation(retention = AnnotationRetention.SOURCE) class publicField \ No newline at end of file +public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class publicField \ No newline at end of file diff --git a/libraries/stdlib/src/kotlin/platform/annotations.kt b/libraries/stdlib/src/kotlin/platform/annotations.kt index 4d80bc91687..8a059bc8bfc 100644 --- a/libraries/stdlib/src/kotlin/platform/annotations.kt +++ b/libraries/stdlib/src/kotlin/platform/annotations.kt @@ -26,7 +26,7 @@ import kotlin.annotation.AnnotationTarget.* * @property name the name of the element. */ target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) -public annotation(retention = AnnotationRetention.RUNTIME) class platformName(public val name: String) +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformName(public val name: String) /** * Specifies that a static method or field needs to be generated from this element. @@ -34,4 +34,4 @@ public annotation(retention = AnnotationRetention.RUNTIME) class platformName(pu * for more information. */ target(FUNCTION, PROPERTY, FIELD, PROPERTY_GETTER, PROPERTY_SETTER) -public annotation(retention = AnnotationRetention.RUNTIME) class platformStatic +public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformStatic