Support using Java-repeatable annotations in Kotlin
#KT-12794
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
// java.lang.NoSuchMethodError: java.lang.Class.getAnnotationsByType
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
import test.A
|
||||
import test.As
|
||||
|
||||
@A("O")
|
||||
@A("")
|
||||
@A("K")
|
||||
class Z
|
||||
|
||||
fun box(): String {
|
||||
val annotations = Z::class.java.annotations.filter { it.annotationClass != Metadata::class }
|
||||
val aa = annotations.singleOrNull() ?: return "Fail 1: $annotations"
|
||||
if (aa !is As) return "Fail 2: $aa"
|
||||
|
||||
val a = aa.value.asList()
|
||||
if (a.size != 3) return "Fail 3: $a"
|
||||
|
||||
val bytype = Z::class.java.getAnnotationsByType(A::class.java)
|
||||
if (a.toList() != bytype.toList()) return "Fail 4: ${a.toList()} != ${bytype.toList()}"
|
||||
|
||||
return a.fold("") { acc, it -> acc + it.value }
|
||||
}
|
||||
|
||||
// FILE: test/A.java
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(As.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface A {
|
||||
String value();
|
||||
}
|
||||
|
||||
// FILE: test/As.java
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface As {
|
||||
A[] value();
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
// java.lang.NoSuchMethodError: java.lang.Class.getAnnotationsByType
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
|
||||
@java.lang.annotation.Repeatable(As::class)
|
||||
annotation class A(val value: String)
|
||||
|
||||
annotation class As(val value: Array<A>)
|
||||
|
||||
@A("O")
|
||||
@A("")
|
||||
@A("K")
|
||||
class Z
|
||||
|
||||
fun box(): String {
|
||||
val annotations = Z::class.java.annotations.filter { it.annotationClass != Metadata::class }
|
||||
val aa = annotations.singleOrNull() ?: return "Fail 1: $annotations"
|
||||
if (aa !is As) return "Fail 2: $aa"
|
||||
|
||||
val a = aa.value.asList()
|
||||
if (a.size != 3) return "Fail 3: $a"
|
||||
|
||||
val bytype = Z::class.java.getAnnotationsByType(A::class.java)
|
||||
if (a.toList() != bytype.toList()) return "Fail 4: ${a.toList()} != ${bytype.toList()}"
|
||||
|
||||
return a.fold("") { acc, it -> acc + it.value }
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
// FILE: box.kt
|
||||
|
||||
package test
|
||||
|
||||
import test.A
|
||||
import test.As
|
||||
|
||||
@A("class1") @A("class2")
|
||||
class Z @A("constructor1") @A("constructor2") constructor() {
|
||||
@A("nestedClass1") @A("nestedClass2")
|
||||
annotation class Nested
|
||||
|
||||
@A("memberFunction1") @A("memberFunction2")
|
||||
fun memberFunction() {}
|
||||
|
||||
@A("memberProperty1") @A("memberProperty2")
|
||||
var memberProperty: Int
|
||||
@A("propertyGetter1") @A("propertyGetter2")
|
||||
get() = 0
|
||||
@A("propertySetter1") @A("propertySetter2")
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
@A("topLevelFunction1") @A("topLevelFunction2")
|
||||
fun topLevelFunction2(
|
||||
@A("parameter1") @A("parameter2")
|
||||
parameter: String
|
||||
) {}
|
||||
|
||||
@A("topLevelProperty1") @A("topLevelProperty2")
|
||||
var String.z: Z
|
||||
@A("propertyGetter1") @A("propertyGetter2")
|
||||
get() = Z()
|
||||
@A("propertySetter1") @A("propertySetter2")
|
||||
set(value) {}
|
||||
|
||||
@get:A("useSitePropertyGetter1")
|
||||
@get:A("useSitePropertyGetter2")
|
||||
@field:A("field1")
|
||||
@field:A("field2")
|
||||
val o: String = ""
|
||||
|
||||
// FILE: test/A.java
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(As.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface A {
|
||||
String value();
|
||||
}
|
||||
|
||||
// FILE: test/As.java
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface As {
|
||||
A[] value();
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
@kotlin.Metadata
|
||||
public final class test/BoxKt {
|
||||
// source: 'box.kt'
|
||||
private final static @test.As(value=[test.A(value="field1"), test.A(value="field2")]) @org.jetbrains.annotations.NotNull field o: java.lang.String
|
||||
static method <clinit>(): void
|
||||
public final static @test.As(value=[test.A(value="useSitePropertyGetter1"), test.A(value="useSitePropertyGetter2")]) @org.jetbrains.annotations.NotNull method getO(): java.lang.String
|
||||
public synthetic deprecated static @test.As(value=[test.A(value="topLevelProperty1"), test.A(value="topLevelProperty2")]) method getZ$annotations(p0: java.lang.String): void
|
||||
public final static @test.As(value=[test.A(value="propertyGetter1"), test.A(value="propertyGetter2")]) @org.jetbrains.annotations.NotNull method getZ(@org.jetbrains.annotations.NotNull p0: java.lang.String): test.Z
|
||||
public final static @test.As(value=[test.A(value="propertySetter1"), test.A(value="propertySetter2")]) method setZ(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: test.Z): void
|
||||
public final static @test.As(value=[test.A(value="topLevelFunction1"), test.A(value="topLevelFunction2")]) method topLevelFunction2(@test.As(value=[test.A(value="parameter1"), test.A(value="parameter2")]) @org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
|
||||
@test.As(value=[test.A(value="nestedClass1"), test.A(value="nestedClass2")])
|
||||
@java.lang.annotation.Retention(value=RUNTIME)
|
||||
@kotlin.Metadata
|
||||
public annotation class test/Z$Nested {
|
||||
// source: 'box.kt'
|
||||
public inner class test/Z$Nested
|
||||
}
|
||||
|
||||
@test.As(value=[test.A(value="class1"), test.A(value="class2")])
|
||||
@kotlin.Metadata
|
||||
public final class test/Z {
|
||||
// source: 'box.kt'
|
||||
public @test.As(value=[test.A(value="constructor1"), test.A(value="constructor2")]) method <init>(): void
|
||||
public synthetic deprecated static @test.As(value=[test.A(value="memberProperty1"), test.A(value="memberProperty2")]) method getMemberProperty$annotations(): void
|
||||
public final @test.As(value=[test.A(value="propertyGetter1"), test.A(value="propertyGetter2")]) method getMemberProperty(): int
|
||||
public final @test.As(value=[test.A(value="memberFunction1"), test.A(value="memberFunction2")]) method memberFunction(): void
|
||||
public final @test.As(value=[test.A(value="propertySetter1"), test.A(value="propertySetter2")]) method setMemberProperty(p0: int): void
|
||||
public inner class test/Z$Nested
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
package test
|
||||
|
||||
@java.lang.annotation.Repeatable(As::class)
|
||||
annotation class A(val value: String)
|
||||
|
||||
annotation class As(val value: Array<A>)
|
||||
|
||||
@A("1")
|
||||
@As([A("2"), A("3")])
|
||||
class Z
|
||||
|
||||
@As([A("1"), A("2")])
|
||||
@A("3")
|
||||
class ZZ
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
@java.lang.annotation.Repeatable(value=test.As::class)
|
||||
@java.lang.annotation.Retention(value=RUNTIME)
|
||||
@kotlin.Metadata
|
||||
public annotation class test/A {
|
||||
// source: 'nonRepeatedAnnotationWithItsContainer.kt'
|
||||
public abstract method value(): java.lang.String
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention(value=RUNTIME)
|
||||
@kotlin.Metadata
|
||||
public annotation class test/As {
|
||||
// source: 'nonRepeatedAnnotationWithItsContainer.kt'
|
||||
public abstract method value(): test.A[]
|
||||
}
|
||||
|
||||
@test.A(value="1")
|
||||
@test.As(value=[test.A(value="2"), test.A(value="3")])
|
||||
@kotlin.Metadata
|
||||
public final class test/Z {
|
||||
// source: 'nonRepeatedAnnotationWithItsContainer.kt'
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
@test.As(value=[test.A(value="1"), test.A(value="2")])
|
||||
@test.A(value="3")
|
||||
@kotlin.Metadata
|
||||
public final class test/ZZ {
|
||||
// source: 'nonRepeatedAnnotationWithItsContainer.kt'
|
||||
public method <init>(): void
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(Runtime.Container.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Runtime {
|
||||
public @interface Container {
|
||||
Runtime[] value();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Clazz.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(Clazz.Container.class)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Clazz {
|
||||
public @interface Container {
|
||||
Clazz[] value();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Source.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(Source.Container.class)
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Source {
|
||||
public @interface Container {
|
||||
Source[] value();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
@Runtime @Runtime
|
||||
class UseRuntime
|
||||
|
||||
@Clazz @Clazz
|
||||
class UseClazz
|
||||
|
||||
@Source @Source
|
||||
class UseSource
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package
|
||||
|
||||
@java.lang.annotation.Repeatable(value = Clazz.Container::class) @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class Clazz : kotlin.Annotation {
|
||||
public constructor Clazz()
|
||||
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
|
||||
|
||||
public final annotation class Container : kotlin.Annotation {
|
||||
public constructor Container(/*0*/ vararg value: Clazz /*kotlin.Array<out Clazz>*/)
|
||||
public final val value: kotlin.Array<Clazz>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.annotation.Repeatable(value = Runtime.Container::class) @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class Runtime : kotlin.Annotation {
|
||||
public constructor Runtime()
|
||||
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
|
||||
|
||||
public final annotation class Container : kotlin.Annotation {
|
||||
public constructor Container(/*0*/ vararg value: Runtime /*kotlin.Array<out Runtime>*/)
|
||||
public final val value: kotlin.Array<Runtime>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.annotation.Repeatable(value = Source.Container::class) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class Source : kotlin.Annotation {
|
||||
public constructor Source()
|
||||
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
|
||||
|
||||
public final annotation class Container : kotlin.Annotation {
|
||||
public constructor Container(/*0*/ vararg value: Source /*kotlin.Array<out Source>*/)
|
||||
public final val value: kotlin.Array<Source>
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@Clazz @Clazz public final class UseClazz {
|
||||
public constructor UseClazz()
|
||||
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
|
||||
}
|
||||
|
||||
@Runtime @Runtime public final class UseRuntime {
|
||||
public constructor UseRuntime()
|
||||
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
|
||||
}
|
||||
|
||||
@Source @Source public final class UseSource {
|
||||
public constructor UseSource()
|
||||
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
|
||||
}
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Runtime {}
|
||||
|
||||
// FILE: Clazz.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Clazz {}
|
||||
|
||||
// FILE: Source.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Source {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
@Runtime @Runtime
|
||||
class UseRuntime
|
||||
|
||||
@Clazz @Clazz
|
||||
class UseClazz
|
||||
|
||||
@Source @Source
|
||||
class UseSource
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Runtime {}
|
||||
|
||||
// FILE: Clazz.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface Clazz {}
|
||||
|
||||
// FILE: Source.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Source {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
@Runtime <!REPEATED_ANNOTATION!>@Runtime<!>
|
||||
class UseRuntime
|
||||
|
||||
@Clazz <!REPEATED_ANNOTATION!>@Clazz<!>
|
||||
class UseClazz
|
||||
|
||||
@Source <!REPEATED_ANNOTATION!>@Source<!>
|
||||
class UseSource
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package
|
||||
|
||||
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class Clazz : kotlin.Annotation {
|
||||
public constructor Clazz()
|
||||
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.Retention(value = AnnotationRetention.RUNTIME) public final annotation class Runtime : kotlin.Annotation {
|
||||
public constructor Runtime()
|
||||
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.Retention(value = AnnotationRetention.SOURCE) public final annotation class Source : kotlin.Annotation {
|
||||
public constructor Source()
|
||||
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
|
||||
}
|
||||
|
||||
@Clazz @Clazz public final class UseClazz {
|
||||
public constructor UseClazz()
|
||||
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
|
||||
}
|
||||
|
||||
@Runtime @Runtime public final class UseRuntime {
|
||||
public constructor UseRuntime()
|
||||
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
|
||||
}
|
||||
|
||||
@Source @Source public final class UseSource {
|
||||
public constructor UseSource()
|
||||
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
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
|
||||
@Repeatable
|
||||
annotation class repann
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
|
||||
@Repeatable
|
||||
annotation class repann
|
||||
|
||||
@@ -28,4 +30,4 @@ annotation class repexpr
|
||||
|
||||
@repann <!NON_SOURCE_REPEATED_ANNOTATION!>@repann<!> fun foo(@repann <!NON_SOURCE_REPEATED_ANNOTATION!>@repann<!> x: Int): Int {
|
||||
@repexpr @repexpr return x
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
|
||||
@Repeatable
|
||||
annotation class repann
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class repann1(val x: Int)
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class repann2(val f: Boolean)
|
||||
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@Repeatable
|
||||
annotation class binrepann
|
||||
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class repexpr
|
||||
|
||||
@repann @repann class DoubleAnnotated
|
||||
|
||||
@repann1(1) @repann1(2) @repann1(3) class TripleAnnotated
|
||||
|
||||
@repann2(true) @repann2(false) @repann2(false) @repann2(true) class FourTimesAnnotated
|
||||
|
||||
@binrepann @binrepann class BinaryAnnotated
|
||||
|
||||
@repann @repann fun foo(@repann @repann x: Int): Int {
|
||||
@repexpr @repexpr return x
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package
|
||||
|
||||
@repann @repann public fun foo(/*0*/ @repann @repann x: kotlin.Int): kotlin.Int
|
||||
|
||||
@binrepann @binrepann public final class BinaryAnnotated {
|
||||
public constructor BinaryAnnotated()
|
||||
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
|
||||
}
|
||||
|
||||
@repann @repann public final class DoubleAnnotated {
|
||||
public constructor DoubleAnnotated()
|
||||
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
|
||||
}
|
||||
|
||||
@repann2(f = true) @repann2(f = false) @repann2(f = false) @repann2(f = true) public final class FourTimesAnnotated {
|
||||
public constructor FourTimesAnnotated()
|
||||
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
|
||||
}
|
||||
|
||||
@repann1(x = 1) @repann1(x = 2) @repann1(x = 3) public final class TripleAnnotated {
|
||||
public constructor TripleAnnotated()
|
||||
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.Retention(value = AnnotationRetention.BINARY) @kotlin.annotation.Repeatable public final annotation 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.Repeatable public final annotation 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.Retention(value = AnnotationRetention.SOURCE) @kotlin.annotation.Repeatable public final annotation class repann1 : kotlin.Annotation {
|
||||
public constructor repann1(/*0*/ x: kotlin.Int)
|
||||
public final val x: kotlin.Int
|
||||
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.Retention(value = AnnotationRetention.SOURCE) @kotlin.annotation.Repeatable public final annotation class repann2 : kotlin.Annotation {
|
||||
public constructor repann2(/*0*/ f: kotlin.Boolean)
|
||||
public final val f: kotlin.Boolean
|
||||
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.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) @kotlin.annotation.Repeatable public final annotation 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
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user