Minor, add test on repeatable annotations on property getters

#KT-14392
 #KT-36476
This commit is contained in:
Alexander Udalov
2021-08-06 19:02:08 +02:00
parent 209c0fe819
commit bc5a79ffcc
3 changed files with 59 additions and 0 deletions
@@ -0,0 +1,23 @@
// !LANGUAGE: +RepeatableAnnotations
// TARGET_BACKEND: JVM_IR
// WITH_RUNTIME
// FULL_JDK
// JVM_TARGET: 1.8
@Repeatable
annotation class A(val v: String)
@get:A("a") @get:A("b")
val ab = 0
@get:A("c") @get:A("d")
val cd: Int
get() = 0
val ef: Int
@A("e") @A("f") get() = 0
@get:A("g")
val ghi: Int
// "i" is not detected because of KT-48141.
@A("h") @get:A("i") get() = 0
@@ -0,0 +1,30 @@
@kotlin.jvm.internal.RepeatableContainer
@java.lang.annotation.Retention(value=RUNTIME)
@kotlin.Metadata
public annotation class A$Container {
// source: 'propertyGetterUseSiteTarget.kt'
public abstract method value(): A[]
public inner class A$Container
}
@kotlin.annotation.Repeatable
@java.lang.annotation.Retention(value=RUNTIME)
@java.lang.annotation.Repeatable(value=A$Container::class)
@kotlin.Metadata
public annotation class A {
// source: 'propertyGetterUseSiteTarget.kt'
public abstract method v(): java.lang.String
public inner class A$Container
}
@kotlin.Metadata
public final class PropertyGetterUseSiteTargetKt {
// source: 'propertyGetterUseSiteTarget.kt'
private final static field ab: int
static method <clinit>(): void
public final static @A$Container(value=[A(v="a"), A(v="b")]) method getAb(): int
public final static @A$Container(value=[A(v="c"), A(v="d")]) method getCd(): int
public final static @A$Container(value=[A(v="e"), A(v="f")]) method getEf(): int
public final static @A$Container(value=[A(v="g"), A(v="h")]) method getGhi(): int
public inner class A$Container
}