annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination
Deprecated test for annotation(params) completion deleted. A lot of tests changed.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
86f35acf9e
commit
eab288bdd7
+12
-12
@@ -283,7 +283,7 @@ public interface Comparable</*0*/ in T> {
|
||||
public abstract fun compareTo(/*0*/ other: T): kotlin.Int
|
||||
}
|
||||
|
||||
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.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true) 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.VALUE_PARAMETER}) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() 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 <get-replaceWith>(): kotlin.ReplaceWith
|
||||
@@ -435,7 +435,7 @@ public abstract class Enum</*0*/ E : kotlin.Enum<E>> : kotlin.Comparable<E> {
|
||||
}
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annotation.annotation(mustBeDocumented = true) public final class Extension : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE}) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class Extension : kotlin.Annotation {
|
||||
/*primary*/ public constructor Extension()
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ public interface FloatingPointConstants</*0*/ T> {
|
||||
public interface Function</*0*/ out R> {
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.BINARY) public final class HiddenDeclaration : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR}) kotlin.annotation.Retention(value = AnnotationRetention.BINARY) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class HiddenDeclaration : kotlin.Annotation {
|
||||
/*primary*/ public constructor HiddenDeclaration()
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,7 @@ public interface Range</*0*/ T : kotlin.Comparable<T>> {
|
||||
public open fun isEmpty(): kotlin.Boolean
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.BINARY) public final class ReplaceWith : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {}) kotlin.annotation.Retention(value = AnnotationRetention.BINARY) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class ReplaceWith : kotlin.Annotation {
|
||||
/*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 fun <get-expression>(): kotlin.String
|
||||
@@ -1251,7 +1251,7 @@ public final class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequenc
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
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.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.annotation() public final class Suppress : kotlin.Annotation {
|
||||
/*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 fun <get-names>(): kotlin.Array<out kotlin.String>
|
||||
@@ -1268,34 +1268,34 @@ public object Unit {
|
||||
/*primary*/ private constructor Unit()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.annotation.annotation(mustBeDocumented = true) public final class data : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.CLASSIFIER}) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class data : kotlin.Annotation {
|
||||
/*primary*/ public constructor data()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.SOURCE) public final class external : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class external : kotlin.Annotation {
|
||||
/*primary*/ public constructor external()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class inline : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class inline : kotlin.Annotation {
|
||||
/*primary*/ public constructor inline(/*0*/ strategy: kotlin.InlineStrategy = ...)
|
||||
public final val strategy: kotlin.InlineStrategy
|
||||
public final fun <get-strategy>(): kotlin.InlineStrategy
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class inlineOptions : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class inlineOptions : kotlin.Annotation {
|
||||
/*primary*/ public constructor inlineOptions(/*0*/ vararg value: kotlin.InlineOption /*kotlin.Array<out kotlin.InlineOption>*/)
|
||||
internal final val value: kotlin.Array<out kotlin.InlineOption>
|
||||
internal final fun <get-value>(): kotlin.Array<out kotlin.InlineOption>
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.annotation(mustBeDocumented = true, retention = AnnotationRetention.RUNTIME) public final class noinline : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER}) kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() public final class noinline : kotlin.Annotation {
|
||||
/*primary*/ public constructor noinline()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.annotation(retention = AnnotationRetention.SOURCE) public final class tailRecursive : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.annotation() public final class tailRecursive : kotlin.Annotation {
|
||||
/*primary*/ public constructor tailRecursive()
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.annotation(retention = AnnotationRetention.SOURCE) public final class tailrec : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.FUNCTION}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.annotation() public final class tailrec : kotlin.Annotation {
|
||||
/*primary*/ public constructor tailrec()
|
||||
}
|
||||
|
||||
Vendored
+2
-1
@@ -12,7 +12,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
Vendored
+2
-1
@@ -1,7 +1,8 @@
|
||||
import java.lang.reflect.Method
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: String)
|
||||
|
||||
fun testMethod(method: Method, name: String) {
|
||||
assertEquals("OK", method.getAnnotation(javaClass<Ann>()).x, "On method of test named `$name`")
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ import java.lang.reflect.Method
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: String)
|
||||
|
||||
fun testMethod(method: Method, name: String) {
|
||||
assertEquals("OK", method.getAnnotation(javaClass<Ann>()).x, "On method of test named `$name`")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val args: Array<KClass<*>>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val args: Array<KClass<*>>)
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<Test>().getAnnotation(javaClass<Ann>()).args
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val arg: KClass<*>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val arg: KClass<*>)
|
||||
|
||||
fun box(): String {
|
||||
val argName = javaClass<Test>().getAnnotation(javaClass<Ann>()).arg.simpleName ?: "fail 1"
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(vararg val args: KClass<*>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(vararg val args: KClass<*>)
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<Test>().getAnnotation(javaClass<Ann>()).args
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import kotlin.jvm.JvmStatic
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class testAnnotation
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class testAnnotation
|
||||
|
||||
class A {
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// KT-5665
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class First
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class First
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Second(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Second(val value: String)
|
||||
|
||||
enum class E {
|
||||
@First
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
import java.lang.reflect.Method
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: String)
|
||||
|
||||
fun foo0(block: () -> Unit) = block.javaClass
|
||||
fun foo1(block: (String) -> Unit) = block.javaClass
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@ import java.lang.reflect.Method
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: String)
|
||||
|
||||
fun foo0(block: () -> Unit) = block.javaClass
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: Int)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val x: Int)
|
||||
class A {
|
||||
Ann(1) fun foo(x: Int, y: Int = 2, z: Int) {}
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int = 1,
|
||||
val s: String = "a",
|
||||
val a: Ann2 = Ann2(),
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class First
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class First
|
||||
|
||||
class MyClass() {
|
||||
public var x: String by Delegate()
|
||||
|
||||
Vendored
+2
-1
@@ -15,7 +15,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val i: Int)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val i: Int)
|
||||
|
||||
class A {
|
||||
class B {
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val b: Byte,
|
||||
val s: Short,
|
||||
val i: Int,
|
||||
|
||||
Vendored
+2
-1
@@ -7,7 +7,8 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val i: Int)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val i: Int)
|
||||
|
||||
val i2: Int = 1
|
||||
val i: Int = i2
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(vararg val p: Int)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(vararg val p: Int)
|
||||
|
||||
Ann() class MyClass1
|
||||
Ann(1) class MyClass2
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package test
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val c1: Int)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val c1: Int)
|
||||
|
||||
Ann('a' - 'a') class MyClass
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val b: Byte,
|
||||
val s: Short,
|
||||
val i: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Int,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Short,
|
||||
val p3: Byte,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Int,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Byte,
|
||||
val p4: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Int,
|
||||
val p4: Long,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Int,
|
||||
val p2: Int,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val p1: Byte,
|
||||
val p2: Short,
|
||||
val p3: Int,
|
||||
|
||||
Vendored
+6
-7
@@ -1,15 +1,14 @@
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Anno
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Anno
|
||||
|
||||
fun box(): String {
|
||||
val a = Anno::class.annotations
|
||||
/*
|
||||
// TODO: support kotlin.annotation.annotation
|
||||
|
||||
if (a.size() != 1) return "Fail 1: $a"
|
||||
val ann = a.single() as? annotation ?: return "Fail 2: ${a.single()}"
|
||||
assertEquals(AnnotationRetention.RUNTIME, ann.retention)
|
||||
*/
|
||||
assert(a.isEmpty())
|
||||
val ann = a.single() as? Retention ?: return "Fail 2: ${a.single()}"
|
||||
assertEquals(AnnotationRetention.RUNTIME, ann.value)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+8
-3
@@ -1,8 +1,13 @@
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
annotation(retention = AnnotationRetention.SOURCE) class SourceAnno
|
||||
annotation(retention = AnnotationRetention.BINARY) class BinaryAnno
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class RuntimeAnno
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class SourceAnno
|
||||
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class BinaryAnno
|
||||
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class RuntimeAnno
|
||||
|
||||
@SourceAnno
|
||||
@BinaryAnno
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Simple(val value: String)
|
||||
|
||||
@Simple("OK")
|
||||
class A
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Simple(val value: String)
|
||||
|
||||
@Simple("OK")
|
||||
fun box(): String {
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Simple(val value: String)
|
||||
|
||||
fun test(@Simple("OK") x: Int) {}
|
||||
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Simple(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Simple(val value: String)
|
||||
|
||||
@property:Simple("OK")
|
||||
val foo: Int = 0
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val args: Array<KClass<*>>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val args: Array<KClass<*>>)
|
||||
|
||||
class O
|
||||
class K
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val arg: KClass<*>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(val arg: KClass<*>)
|
||||
|
||||
class OK
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(vararg val args: KClass<*>)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(vararg val args: KClass<*>)
|
||||
|
||||
class O
|
||||
class K
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import java.lang.annotation.Annotation
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class foo(val name : String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class foo(val name : String)
|
||||
|
||||
class Test() {
|
||||
foo("OK") fun hello(input : String) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Ann class MyClass
|
||||
|
||||
annotation(retention = AnnotationRetention.BINARY) class Ann
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class Ann
|
||||
|
||||
// 1 @LAnn;()
|
||||
// 1 invisible
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Ann class MyClass
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann
|
||||
|
||||
// 1 @LAnn;()
|
||||
// 0 invisible
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Ann class MyClass
|
||||
|
||||
annotation(retention = AnnotationRetention.SOURCE) class Ann
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class Ann
|
||||
|
||||
// 0 @LAnn;()
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class SomeAnnotation(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class SomeAnnotation(val value: String)
|
||||
|
||||
class A {
|
||||
@SomeAnnotation("OK") val property: Int
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class SomeAnnotation(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class SomeAnnotation(val value: String)
|
||||
|
||||
interface T {
|
||||
@SomeAnnotation("OK") val property: Int
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class SomeAnnotation(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class SomeAnnotation(val value: String)
|
||||
|
||||
@SomeAnnotation("OK") val property: Int
|
||||
get() = 42
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package a
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann
|
||||
|
||||
interface Tr {
|
||||
Ann
|
||||
|
||||
@@ -11,4 +11,5 @@ public val c: Char = '\u03c0' // pi symbol
|
||||
|
||||
public val str: String = ":)"
|
||||
|
||||
public annotation(retention = AnnotationRetention.RUNTIME) class AnnotationClass(public val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
public annotation class AnnotationClass(public val value: String)
|
||||
+2
-1
@@ -6,7 +6,8 @@ class MyClass1
|
||||
Ann(i2, s2, f2, d2, l2, b2, bool2, c2, str2)
|
||||
class MyClass2
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Ann(
|
||||
val i: Int,
|
||||
val s: Short,
|
||||
val f: Float,
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val x: Int = 1)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val x: Int = 1)
|
||||
|
||||
inline fun bar(block: () -> Int): Int = block()
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package
|
||||
kotlin.inline() internal fun bar(/*0*/ block: () -> kotlin.Int): kotlin.Int
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ x: kotlin.Int = ...)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
target(AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER,
|
||||
AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION,
|
||||
AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val x: Int = 6)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val x: Int = 6)
|
||||
|
||||
@Ann(1) @Ann(2) @Ann(3) @private class A @Ann constructor() {
|
||||
@Ann(x = 5) fun foo() {
|
||||
|
||||
@@ -10,7 +10,7 @@ Ann(x = 1) Ann(x = 2) Ann(x = 3) private final class A {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ x: kotlin.Int = ...)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
annotation(mustBeDocumented = true) class DocAnn
|
||||
@MustBeDocumented
|
||||
annotation class DocAnn
|
||||
|
||||
annotation class NotDocAnn
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package
|
||||
|
||||
kotlin.annotation.annotation(mustBeDocumented = true) internal final class DocAnn : kotlin.Annotation {
|
||||
kotlin.annotation.MustBeDocumented() kotlin.annotation.annotation() internal final class DocAnn : kotlin.Annotation {
|
||||
public constructor DocAnn()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
annotation(repeatable = true) class repann
|
||||
@Repeatable
|
||||
annotation class repann
|
||||
|
||||
annotation(retention = AnnotationRetention.SOURCE, repeatable = true) class repann1(val x: Int)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class repann1(val x: Int)
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class repann2(val f: Boolean)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class repann2(val f: Boolean)
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.BINARY) class binrepann
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@Repeatable
|
||||
annotation class binrepann
|
||||
|
||||
target(AnnotationTarget.EXPRESSION) annotation(repeatable = true) class repexpr
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
@Repeatable
|
||||
annotation class repexpr
|
||||
|
||||
repann <!NON_SOURCE_REPEATED_ANNOTATION!>repann<!> class DoubleAnnotated
|
||||
|
||||
|
||||
@@ -30,21 +30,21 @@ repann1(x = 1) repann1(x = 2) repann1(x = 3) internal final class TripleAnnotate
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.BINARY) internal final class binrepann : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.BINARY) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class binrepann : kotlin.Annotation {
|
||||
public constructor binrepann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class repann : kotlin.Annotation {
|
||||
kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class repann : kotlin.Annotation {
|
||||
public constructor repann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class repann1 : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class repann1 : kotlin.Annotation {
|
||||
public constructor repann1(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -52,7 +52,7 @@ kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class repann2 : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class repann2 : kotlin.Annotation {
|
||||
public constructor repann2(/*0*/ f: kotlin.Boolean)
|
||||
internal final val f: kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -60,7 +60,7 @@ kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true) internal final class repexpr : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class repexpr : kotlin.Annotation {
|
||||
public constructor repexpr()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
annotation(AnnotationRetention.SOURCE) class sourceann
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class sourceann
|
||||
|
||||
sourceann class AnnotatedAtSource
|
||||
|
||||
@@ -7,7 +7,7 @@ sourceann() internal final class AnnotatedAtSource {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(retention = AnnotationRetention.SOURCE) internal final class sourceann : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.annotation() internal final class sourceann : kotlin.Annotation {
|
||||
public constructor sourceann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
annotation(repeatable = false) class unrepann(val x: Int)
|
||||
annotation class unrepann(val x: Int)
|
||||
|
||||
annotation class ann(val y: Int)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = false) internal final class unrepann : kotlin.Annotation {
|
||||
kotlin.annotation.annotation() internal final class unrepann : kotlin.Annotation {
|
||||
public constructor unrepann(/*0*/ x: kotlin.Int)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class RepeatableAnn
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class RepeatableAnn
|
||||
annotation class Ann
|
||||
|
||||
public class A(@param:Ann <!REPEATED_ANNOTATION!>@Ann<!> val x: Int, @param: RepeatableAnn @Ann val y: Int) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class RepeatableAnn : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class RepeatableAnn : kotlin.Annotation {
|
||||
public constructor RepeatableAnn()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann
|
||||
|
||||
fun <T> bar(block: (T) -> Int) {}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package
|
||||
internal fun </*0*/ T> bar(/*0*/ block: (T) -> kotlin.Int): kotlin.Unit
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt
Vendored
+6
-2
@@ -1,4 +1,6 @@
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val i: IntArray)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val i: IntArray)
|
||||
|
||||
Ann(intArrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>i<!>))
|
||||
Ann(intArrayOf(i2))
|
||||
@@ -13,7 +15,9 @@ val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class AnnAnn(val i: Array<Ann>)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class AnnAnn(val i: Array<Ann>)
|
||||
AnnAnn(arrayOf(Ann(intArrayOf(1))))
|
||||
AnnAnn(arrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>iAnn<!>))
|
||||
class TestAnn
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ internal val i3: kotlin.Int
|
||||
internal val iAnn: Ann
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ i: kotlin.IntArray)
|
||||
internal final val i: kotlin.IntArray
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -14,7 +14,7 @@ kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class AnnAnn : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class AnnAnn : kotlin.Annotation {
|
||||
public constructor AnnAnn(/*0*/ i: kotlin.Array<Ann>)
|
||||
internal final val i: kotlin.Array<Ann>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val i: Int)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val i: Int)
|
||||
annotation class AnnIA(val ia: IntArray)
|
||||
annotation class AnnSA(val sa: Array<String>)
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ internal val ia: kotlin.IntArray
|
||||
internal val sa: kotlin.Array<kotlin.String>
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ i: kotlin.Int)
|
||||
internal final val i: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+6
-2
@@ -1,4 +1,6 @@
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(vararg val i: Int)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(vararg val i: Int)
|
||||
|
||||
Ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>i<!>)
|
||||
Ann(i2)
|
||||
@@ -16,7 +18,9 @@ val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class AnnAnn(vararg val i: Ann)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class AnnAnn(vararg val i: Ann)
|
||||
AnnAnn(*arrayOf(Ann(1)))
|
||||
AnnAnn(*arrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>iAnn<!>))
|
||||
class TestAnn
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ internal val i3: kotlin.Int
|
||||
internal val iAnn: Ann
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ vararg i: kotlin.Int /*kotlin.IntArray*/)
|
||||
internal final val i: kotlin.IntArray
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -14,7 +14,7 @@ kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class AnnAnn : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) kotlin.annotation.Repeatable() kotlin.annotation.annotation() internal final class AnnAnn : kotlin.Annotation {
|
||||
public constructor AnnAnn(/*0*/ vararg i: Ann /*kotlin.Array<out Ann>*/)
|
||||
internal final val i: kotlin.Array<out Ann>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
//SKIP_IN_RUNTIME_TEST
|
||||
package test
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Anno
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class Anno
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
kotlin.annotation.annotation(retention = AnnotationRetention.RUNTIME) internal final class Anno : kotlin.Annotation {
|
||||
kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) kotlin.annotation.annotation() internal final class Anno : kotlin.Annotation {
|
||||
/*primary*/ public constructor Anno()
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
* for more information.
|
||||
*/
|
||||
target(CLASSIFIER)
|
||||
public annotation(mustBeDocumented = true) class data
|
||||
@MustBeDocumented
|
||||
public annotation class data
|
||||
|
||||
/**
|
||||
* Marks the annotated class, function, property, variable or parameter as deprecated.
|
||||
@@ -37,7 +38,8 @@ public annotation(mustBeDocumented = true) class data
|
||||
*/
|
||||
target(CLASSIFIER, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER,
|
||||
LOCAL_VARIABLE, VALUE_PARAMETER)
|
||||
public annotation(mustBeDocumented = true) class Deprecated(val value: String, val replaceWith: ReplaceWith = ReplaceWith(""))
|
||||
@MustBeDocumented
|
||||
public annotation class Deprecated(val value: String, val replaceWith: ReplaceWith = ReplaceWith(""))
|
||||
|
||||
/**
|
||||
* Specifies a code fragment that can be used to replace a deprecated function, property or class. Tools such
|
||||
@@ -53,13 +55,16 @@ public annotation(mustBeDocumented = true) class Deprecated(val value: String, v
|
||||
* replacement expression to be resolved correctly.
|
||||
*/
|
||||
target()
|
||||
public annotation(retention = BINARY, mustBeDocumented = true) class ReplaceWith(val expression: String, vararg val imports: String)
|
||||
@Retention(BINARY)
|
||||
@MustBeDocumented
|
||||
public annotation class ReplaceWith(val expression: String, vararg val imports: String)
|
||||
|
||||
/**
|
||||
* Signifies that the annotated functional type represents an extension function.
|
||||
*/
|
||||
target(TYPE)
|
||||
public annotation(mustBeDocumented = true) class Extension
|
||||
@MustBeDocumented
|
||||
public annotation class Extension
|
||||
|
||||
/**
|
||||
* Suppresses the given compilation warnings in the annotated element.
|
||||
@@ -67,7 +72,8 @@ public annotation(mustBeDocumented = true) class Extension
|
||||
*/
|
||||
target(CLASSIFIER, ANNOTATION_CLASS, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER,
|
||||
CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, TYPE, EXPRESSION, FILE)
|
||||
public annotation(retention = SOURCE) class Suppress(vararg val names: String)
|
||||
@Retention(SOURCE)
|
||||
public annotation class Suppress(vararg val names: String)
|
||||
|
||||
/**
|
||||
* Enables the tail call optimization for the annotated function. If the annotated function
|
||||
@@ -77,10 +83,12 @@ public annotation(retention = SOURCE) class Suppress(vararg val names: String)
|
||||
*/
|
||||
target(FUNCTION)
|
||||
// @deprecated("Use kotlin.tailrec instead", ReplaceWith("kotlin.tailrec"))
|
||||
public annotation(retention = SOURCE) class tailRecursive
|
||||
@Retention(SOURCE)
|
||||
public annotation class tailRecursive
|
||||
|
||||
target(FUNCTION)
|
||||
public annotation(retention = SOURCE) class tailrec
|
||||
@Retention(SOURCE)
|
||||
public annotation class tailrec
|
||||
|
||||
/**
|
||||
* Hides the annotated function, property or constructor from the overload resolution,
|
||||
@@ -88,12 +96,15 @@ public annotation(retention = SOURCE) class tailrec
|
||||
* to retain binary compatibility with the code compiled against it before.
|
||||
*/
|
||||
target(FUNCTION, PROPERTY, CONSTRUCTOR)
|
||||
annotation(retention = BINARY, mustBeDocumented = true)
|
||||
public class HiddenDeclaration
|
||||
@Retention(BINARY)
|
||||
@MustBeDocumented
|
||||
public annotation class HiddenDeclaration
|
||||
|
||||
/**
|
||||
* Marks annotated function as `external`, meaning that it's not implemented
|
||||
* in Kotlin but rather in a different language (for example, in C/C++ using JNI or JavaScript).
|
||||
*/
|
||||
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class external
|
||||
@Retention(SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class external
|
||||
|
||||
@@ -21,7 +21,9 @@ package kotlin
|
||||
* function literals passed as arguments for this parameter.
|
||||
*/
|
||||
target(AnnotationTarget.VALUE_PARAMETER)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class noinline
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation class noinline
|
||||
|
||||
/**
|
||||
* Enables inlining of the annotated function and the function literals that it takes as parameters into the
|
||||
@@ -35,7 +37,9 @@ public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = tr
|
||||
* @see inlineOptions
|
||||
*/
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation class inline(public val strategy: InlineStrategy = InlineStrategy.AS_FUNCTION)
|
||||
|
||||
/**
|
||||
* Specifies the strategy for code generation for an inline function.
|
||||
@@ -64,7 +68,9 @@ public enum class InlineStrategy {
|
||||
* @property value the inlining options selected for the annotated function parameter.
|
||||
*/
|
||||
target(AnnotationTarget.VALUE_PARAMETER)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class inlineOptions(vararg val value: InlineOption)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation 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
|
||||
|
||||
@@ -73,22 +73,17 @@ public enum class AnnotationRetention {
|
||||
* @property allowedTargets list of allowed annotation targets
|
||||
*/
|
||||
target(AnnotationTarget.ANNOTATION_CLASS)
|
||||
public annotation(mustBeDocumented = true) class target(vararg val allowedTargets: AnnotationTarget)
|
||||
@MustBeDocumented
|
||||
public annotation class target(vararg val allowedTargets: AnnotationTarget)
|
||||
|
||||
/**
|
||||
* This special meta-annotation is used to declare an annotation and to set its base properties.
|
||||
* This special meta-annotation is used to declare an annotation.
|
||||
* So a class in Kotlin is an annotation if and only if it has the "annotation" meta-annotation.
|
||||
*
|
||||
* @property retention determines whether the annotation is stored in binary output and visible for reflection. By default, both are true.
|
||||
* @property repeatable true if annotation is repeatable (applicable twice or more on a single code element), otherwise false (default)
|
||||
* @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, mustBeDocumented = true) class annotation (
|
||||
val retention: AnnotationRetention = AnnotationRetention.RUNTIME,
|
||||
val repeatable: Boolean = false,
|
||||
val mustBeDocumented: Boolean = false
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class annotation
|
||||
|
||||
/**
|
||||
* This meta-annotation determines whether an annotation is stored in binary output and visible for reflection. By default, both are true.
|
||||
|
||||
@@ -35,4 +35,6 @@ package kotlin.jvm
|
||||
* MyList<Int?>().add(null) // Ok
|
||||
*/
|
||||
target(AnnotationTarget.CLASSIFIER)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class PurelyImplements(public val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation class PurelyImplements(public val value: String)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package kotlin.jvm.internal
|
||||
|
||||
import java.lang.annotation.*
|
||||
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME) class Intrinsic(val value: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
public annotation class Intrinsic(val value: String)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
annotation(<caret>) class Annotated
|
||||
|
||||
// EXIST: retention
|
||||
// EXIST: repeatable
|
||||
-6
@@ -717,12 +717,6 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationArguments.kt")
|
||||
public void testAnnotationArguments() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/annotations/AnnotationArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationTarget.kt")
|
||||
public void testAnnotationTarget() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/annotations/AnnotationTarget.kt");
|
||||
|
||||
-6
@@ -717,12 +717,6 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationArguments.kt")
|
||||
public void testAnnotationArguments() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/annotations/AnnotationArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationTarget.kt")
|
||||
public void testAnnotationTarget() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/common/annotations/AnnotationTarget.kt");
|
||||
|
||||
+3
-1
@@ -20,4 +20,6 @@ val BAZ = "baz"
|
||||
val N = 0
|
||||
|
||||
target(AnnotationTarget.FILE)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class myAnnotation(val i: Int, val s: String)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class myAnnotation(val i: Int, val s: String)
|
||||
|
||||
@@ -32,6 +32,8 @@ annotation class a
|
||||
|
||||
target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION, AnnotationTarget.CLASSIFIER,
|
||||
AnnotationTarget.CONSTRUCTOR, AnnotationTarget.TYPE)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class b(val e: E)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class b(val e: E)
|
||||
|
||||
enum class E { E1, E2 }
|
||||
@@ -18,4 +18,5 @@ package kotlin.jvm
|
||||
|
||||
// is used in common generated code in stdlib
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
|
||||
internal annotation(retention = AnnotationRetention.SOURCE) class jvmOverloads
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
internal annotation class jvmOverloads
|
||||
|
||||
@@ -25,10 +25,12 @@ import kotlin.InlineOption.ONLY_LOCAL_RETURN
|
||||
|
||||
native
|
||||
target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
|
||||
public annotation(retention = AnnotationRetention.SOURCE) class volatile
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class volatile
|
||||
|
||||
native
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.SOURCE) class synchronized
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class synchronized
|
||||
|
||||
public inline fun <R> synchronized(lock: Any, @inlineOptions(ONLY_LOCAL_RETURN) block: () -> R): R = block()
|
||||
|
||||
@@ -23,14 +23,18 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
* are immediately made visible to other threads.
|
||||
*/
|
||||
target(FIELD)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Volatile
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation 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(FIELD)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Transient
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class Transient
|
||||
|
||||
/**
|
||||
* Marks the JVM method generated from the annotated function as `strictfp`, meaning that the precision
|
||||
@@ -38,7 +42,9 @@ public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = tru
|
||||
* achieve better portability.
|
||||
*/
|
||||
target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, CLASSIFIER)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Strictfp
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class Strictfp
|
||||
|
||||
/**
|
||||
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
|
||||
@@ -46,12 +52,16 @@ public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = tru
|
||||
* for static methods, the class) on which the method is defined.
|
||||
*/
|
||||
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class Synchronized
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation 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)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
@deprecated("Use kotlin.external instead", ReplaceWith("kotlin.external"))
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class native
|
||||
public annotation class native
|
||||
|
||||
@@ -23,7 +23,9 @@ 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, mustBeDocumented = true) class JvmOverloads
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@MustBeDocumented
|
||||
public annotation class JvmOverloads
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,7 +34,9 @@ public annotation(retention = AnnotationRetention.BINARY, mustBeDocumented = tru
|
||||
* for more information.
|
||||
*/
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class JvmStatic
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation class JvmStatic
|
||||
|
||||
/**
|
||||
* Specifies the name for the Java class or method
|
||||
@@ -42,10 +46,14 @@ public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = tr
|
||||
* @property name the name of the element.
|
||||
*/
|
||||
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class JvmName(public val name: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
public annotation class JvmName(public val name: String)
|
||||
|
||||
/**
|
||||
* Instructs the Kotlin compiler to generate a public backing field for this property.
|
||||
*/
|
||||
target(AnnotationTarget.FIELD)
|
||||
public annotation(retention = AnnotationRetention.SOURCE, mustBeDocumented = true) class publicField
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class publicField
|
||||
@@ -19,9 +19,13 @@ package kotlin.platform
|
||||
import kotlin.annotation.AnnotationTarget.*
|
||||
|
||||
target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName"))
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformName(public val name: String)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
@deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName"))
|
||||
public annotation class platformName(public val name: String)
|
||||
|
||||
target(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
deprecated("Use kotlin.jvm.JvmStatic instead", ReplaceWith("kotlin.jvm.JvmStatic"))
|
||||
public annotation(retention = AnnotationRetention.RUNTIME, mustBeDocumented = true) class platformStatic
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@MustBeDocumented
|
||||
@deprecated("Use kotlin.jvm.JvmStatic instead", ReplaceWith("kotlin.jvm.JvmStatic"))
|
||||
public annotation class platformStatic
|
||||
|
||||
@@ -22,7 +22,8 @@ import kotlin.reflect.KClass
|
||||
*
|
||||
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
|
||||
*/
|
||||
public annotation(retention = AnnotationRetention.SOURCE) class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class Throws(public vararg val exceptionClasses: KClass<out Throwable>)
|
||||
|
||||
/**
|
||||
* Returns the runtime Java class of this object.
|
||||
|
||||
@@ -4,7 +4,8 @@ import kotlin.*
|
||||
import kotlin.test.assertTrue
|
||||
import org.junit.Test as test
|
||||
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class MyAnno
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class MyAnno
|
||||
|
||||
@MyAnno
|
||||
@java.lang.Deprecated
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
package org.test
|
||||
|
||||
public annotation(retention = AnnotationRetention.BINARY) class SomeAnnotation
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
public annotation class SomeAnnotation
|
||||
|
||||
SomeAnnotation public class SomeClass {
|
||||
|
||||
|
||||
+6
-4
@@ -1,6 +1,8 @@
|
||||
a java.lang.annotation.Retention 0
|
||||
a kotlin.annotation.Retention 0
|
||||
p org.test 0
|
||||
c 0 0/SomeAnnotation
|
||||
a org.test.SomeAnnotation 1
|
||||
c 1 0/SomeClass
|
||||
m 1 0/SomeClass annotatedFunction
|
||||
a java.lang.annotation.Retention 1
|
||||
c 1 0/SomeAnnotation
|
||||
a org.test.SomeAnnotation 2
|
||||
c 2 0/SomeClass
|
||||
m 2 0/SomeClass annotatedFunction
|
||||
|
||||
Reference in New Issue
Block a user