[FIR] Add REPEATED_ANNOTATION, REPEATED_ANNOTATION_WARNING
This commit is contained in:
committed by
TeamCityServer
parent
fa12e72551
commit
55f33999f1
-142
@@ -1,142 +0,0 @@
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: JR.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(JR.Container.class)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface JR {
|
||||
public @interface Container {
|
||||
JR[] value();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: JS.java
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Repeatable(JS.Container.class)
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface JS {
|
||||
public @interface Container {
|
||||
JS[] value();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KR.kt
|
||||
|
||||
@java.lang.annotation.Repeatable(KR.Container::class)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class KR {
|
||||
annotation class Container(val value: Array<KR>)
|
||||
}
|
||||
|
||||
// FILE: KS.kt
|
||||
|
||||
@java.lang.annotation.Repeatable(KS.Container::class)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class KS {
|
||||
annotation class Container(val value: Array<KS>)
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
// Java runtime-retained annotation
|
||||
|
||||
@JR
|
||||
@JR.Container()
|
||||
fun jr1() {}
|
||||
|
||||
@JR
|
||||
@JR.Container()
|
||||
<!NON_SOURCE_REPEATED_ANNOTATION!>@JR<!>
|
||||
fun jr2() {}
|
||||
|
||||
@JR
|
||||
@JR.Container(JR())
|
||||
<!NON_SOURCE_REPEATED_ANNOTATION!>@JR<!>
|
||||
fun jr3() {}
|
||||
|
||||
@JR
|
||||
@JR.Container(JR())
|
||||
fun jr4() {}
|
||||
|
||||
@JR
|
||||
@JR.Container(JR(), JR())
|
||||
fun jr5() {}
|
||||
|
||||
|
||||
// Java source-retained annotation
|
||||
|
||||
@JS
|
||||
@JS.Container()
|
||||
fun js1() {}
|
||||
|
||||
@JS
|
||||
@JS.Container()
|
||||
@JS
|
||||
fun js2() {}
|
||||
|
||||
@JS
|
||||
@JS.Container(JS())
|
||||
@JS
|
||||
fun js3() {}
|
||||
|
||||
@JS
|
||||
@JS.Container(JS())
|
||||
fun js4() {}
|
||||
|
||||
@JS
|
||||
@JS.Container(JS(), JS())
|
||||
fun js5() {}
|
||||
|
||||
|
||||
// Kotlin runtime-retained annotation
|
||||
|
||||
@KR.Container([])
|
||||
@KR
|
||||
fun kr1() {}
|
||||
|
||||
@KR.Container([])
|
||||
@KR
|
||||
@KR
|
||||
fun kr2() {}
|
||||
|
||||
@KR
|
||||
@KR
|
||||
@KR.Container([KR()])
|
||||
fun kr3() {}
|
||||
|
||||
@KR.Container([KR()])
|
||||
@KR
|
||||
fun kr4() {}
|
||||
|
||||
@KR
|
||||
@KR.Container([KR(), KR()])
|
||||
fun kr5() {}
|
||||
|
||||
|
||||
// Kotlin source-retained annotation
|
||||
|
||||
@KS.Container([])
|
||||
@KS
|
||||
fun ks1() {}
|
||||
|
||||
@KS.Container([])
|
||||
@KS
|
||||
@KS
|
||||
fun ks2() {}
|
||||
|
||||
@KS
|
||||
@KS
|
||||
@KS.Container([KS()])
|
||||
fun ks3() {}
|
||||
|
||||
@KS.Container([KS()])
|
||||
@KS
|
||||
fun ks4() {}
|
||||
|
||||
@KS
|
||||
@KS.Container([KS(), KS()])
|
||||
fun ks5() {}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: JR.java
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
// !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 <!NON_SOURCE_REPEATED_ANNOTATION!>@Runtime<!>
|
||||
class UseRuntime
|
||||
|
||||
@Clazz <!NON_SOURCE_REPEATED_ANNOTATION!>@Clazz<!>
|
||||
class UseClazz
|
||||
|
||||
@Source @Source
|
||||
class UseSource
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
// !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
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
// !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
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +RepeatableAnnotations
|
||||
// FULL_JDK
|
||||
// FILE: Runtime.java
|
||||
|
||||
Reference in New Issue
Block a user