Support using Java-repeatable annotations in Kotlin
#KT-12794
This commit is contained in:
+27
-9
@@ -2095,21 +2095,39 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaRepeatable.kt")
|
||||
public void testJavaRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_5.kt")
|
||||
public void testJavaRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable.kt")
|
||||
public void testJavaUnrepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_6.kt")
|
||||
public void testJavaRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable.kt")
|
||||
public void testKotlinRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt");
|
||||
@TestMetadata("javaUnrepeatable_1_5.kt")
|
||||
public void testJavaUnrepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable_1_6.kt")
|
||||
public void testJavaUnrepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_5.kt")
|
||||
public void testKotlinRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_6.kt")
|
||||
public void testKotlinRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_6.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+27
-9
@@ -2095,21 +2095,39 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaRepeatable.kt")
|
||||
public void testJavaRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_5.kt")
|
||||
public void testJavaRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable.kt")
|
||||
public void testJavaUnrepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_6.kt")
|
||||
public void testJavaRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable.kt")
|
||||
public void testKotlinRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt");
|
||||
@TestMetadata("javaUnrepeatable_1_5.kt")
|
||||
public void testJavaUnrepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable_1_6.kt")
|
||||
public void testJavaUnrepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_5.kt")
|
||||
public void testKotlinRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_6.kt")
|
||||
public void testKotlinRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_6.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
@@ -496,6 +496,28 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Repeatable {
|
||||
@Test
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaAnnotation.kt")
|
||||
public void testJavaAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/repeatable/javaAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmRepeatableKotlinAnnotation.kt")
|
||||
public void testJvmRepeatableKotlinAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/repeatable/jvmRepeatableKotlinAnnotation.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+9
-2
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.jvm.checkers
|
||||
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget
|
||||
import org.jetbrains.kotlin.descriptors.annotations.KotlinRetention
|
||||
@@ -19,13 +20,17 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.getAnnotationRetention
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isRepeatableAnnotation
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
|
||||
|
||||
object RepeatableAnnotationChecker : AdditionalAnnotationChecker {
|
||||
class RepeatableAnnotationChecker(languageVersionSettings: LanguageVersionSettings) : AdditionalAnnotationChecker {
|
||||
private val nonSourceDisallowed = !languageVersionSettings.supportsFeature(LanguageFeature.RepeatableAnnotations)
|
||||
|
||||
override fun checkEntries(
|
||||
entries: List<KtAnnotationEntry>,
|
||||
actualTargets: List<KotlinTarget>,
|
||||
trace: BindingTrace,
|
||||
languageVersionSettings: LanguageVersionSettings
|
||||
) {
|
||||
if (entries.isEmpty()) return
|
||||
|
||||
val entryTypesWithAnnotations = hashMapOf<FqName, MutableList<AnnotationUseSiteTarget?>>()
|
||||
|
||||
for (entry in entries) {
|
||||
@@ -42,7 +47,9 @@ object RepeatableAnnotationChecker : AdditionalAnnotationChecker {
|
||||
&& classDescriptor.isRepeatableAnnotation()
|
||||
&& classDescriptor.getAnnotationRetention() != KotlinRetention.SOURCE
|
||||
) {
|
||||
trace.report(ErrorsJvm.NON_SOURCE_REPEATED_ANNOTATION.on(entry))
|
||||
if (nonSourceDisallowed) {
|
||||
trace.report(ErrorsJvm.NON_SOURCE_REPEATED_ANNOTATION.on(entry))
|
||||
}
|
||||
}
|
||||
|
||||
existingTargetsForAnnotation.add(useSiteTarget)
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
|
||||
|
||||
MAP.put(POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION, "Only named arguments are available for Java annotations");
|
||||
MAP.put(DEPRECATED_JAVA_ANNOTATION, "This annotation is deprecated in Kotlin. Use ''@{0}'' instead", TO_STRING);
|
||||
MAP.put(NON_SOURCE_REPEATED_ANNOTATION, "Repeatable annotations with non-SOURCE retention are not yet supported");
|
||||
MAP.put(NON_SOURCE_REPEATED_ANNOTATION, "Repeatable annotations with non-SOURCE retention are only supported starting from Kotlin 1.6");
|
||||
MAP.put(ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES, "Annotation ''@{0}'' is not applicable to the multi-file classes", TO_STRING);
|
||||
|
||||
MAP.put(JVM_PACKAGE_NAME_CANNOT_BE_EMPTY, "''@JvmPackageName'' annotation value cannot be empty");
|
||||
|
||||
+1
-1
@@ -73,7 +73,6 @@ object JvmPlatformConfigurator : PlatformConfiguratorBase(
|
||||
),
|
||||
|
||||
additionalAnnotationCheckers = listOf(
|
||||
RepeatableAnnotationChecker,
|
||||
FileClassAnnotationsChecker,
|
||||
ExplicitMetadataChecker
|
||||
),
|
||||
@@ -125,5 +124,6 @@ object JvmPlatformConfigurator : PlatformConfiguratorBase(
|
||||
override fun configureModuleDependentCheckers(container: StorageComponentContainer) {
|
||||
super.configureModuleDependentCheckers(container)
|
||||
container.useImpl<ExpectedActualDeclarationChecker>()
|
||||
container.useImpl<RepeatableAnnotationChecker>()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,6 +323,7 @@ private val jvmFilePhases = listOf(
|
||||
|
||||
inventNamesForLocalClassesPhase,
|
||||
kCallableNamePropertyPhase,
|
||||
repeatedAnnotationPhase,
|
||||
annotationPhase,
|
||||
annotationImplementationPhase,
|
||||
polymorphicSignaturePhase,
|
||||
|
||||
+1
-1
@@ -450,7 +450,7 @@ private fun isBareTypeParameterWithNullableUpperBound(type: IrType): Boolean {
|
||||
|
||||
private val RETENTION_PARAMETER_NAME = Name.identifier("value")
|
||||
|
||||
private fun IrClass.getAnnotationRetention(): KotlinRetention? {
|
||||
internal fun IrClass.getAnnotationRetention(): KotlinRetention? {
|
||||
val retentionArgument =
|
||||
getAnnotation(StandardNames.FqNames.retention)?.getValueArgument(RETENTION_PARAMETER_NAME)
|
||||
as? IrGetEnumValue ?: return null
|
||||
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.lower
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.FileLoweringPass
|
||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.AnnotationCodegen.Companion.annotationClass
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.expressions.IrClassReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.types.typeWith
|
||||
import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.isAnnotation
|
||||
import org.jetbrains.kotlin.ir.util.primaryConstructor
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptVoid
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
|
||||
internal val repeatedAnnotationPhase = makeIrFilePhase(
|
||||
::RepeatedAnnotationLowering,
|
||||
name = "RepeatedAnnotation",
|
||||
description = "Enclose repeated annotations in a container annotation, generating a container class if needed"
|
||||
)
|
||||
|
||||
class RepeatedAnnotationLowering(private val context: JvmBackendContext) : FileLoweringPass, IrElementVisitorVoid {
|
||||
override fun lower(irFile: IrFile) {
|
||||
irFile.acceptVoid(this)
|
||||
}
|
||||
|
||||
override fun visitElement(element: IrElement) {
|
||||
element.acceptChildrenVoid(this)
|
||||
}
|
||||
|
||||
override fun visitFile(declaration: IrFile) {
|
||||
declaration.annotations = transformAnnotations(declaration.annotations)
|
||||
super.visitFile(declaration)
|
||||
}
|
||||
|
||||
override fun visitDeclaration(declaration: IrDeclarationBase) {
|
||||
declaration.annotations = transformAnnotations(declaration.annotations)
|
||||
super.visitDeclaration(declaration)
|
||||
}
|
||||
|
||||
private fun transformAnnotations(annotations: List<IrConstructorCall>): List<IrConstructorCall> {
|
||||
if (annotations.size < 2) return annotations
|
||||
|
||||
val annotationsByClass = annotations.groupByTo(mutableMapOf()) { it.annotationClass }
|
||||
if (annotationsByClass.values.none { it.size > 1 }) return annotations
|
||||
|
||||
val result = mutableListOf<IrConstructorCall>()
|
||||
for (annotation in annotations) {
|
||||
val annotationClass = annotation.annotationClass
|
||||
val grouped = annotationsByClass.remove(annotationClass) ?: continue
|
||||
if (grouped.size < 2) {
|
||||
result.add(grouped.single())
|
||||
continue
|
||||
}
|
||||
|
||||
val containerClass = getOrCreateContainerClass(annotationClass)
|
||||
result.add(wrapAnnotationEntriesInContainer(annotationClass, containerClass, grouped))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private fun getOrCreateContainerClass(annotationClass: IrClass): IrClass {
|
||||
val metaAnnotations = annotationClass.annotations
|
||||
val jvmRepeatable = metaAnnotations.find { it.isAnnotation(JvmAnnotationNames.REPEATABLE_ANNOTATION) }
|
||||
return if (jvmRepeatable != null) {
|
||||
val containerClassReference = jvmRepeatable.getValueArgument(0)
|
||||
require(containerClassReference is IrClassReference) {
|
||||
"Repeatable annotation container value must be a class reference: $annotationClass"
|
||||
}
|
||||
(containerClassReference.symbol as? IrClassSymbol)?.owner
|
||||
?: error("Repeatable annotation container must be a class: $annotationClass")
|
||||
} else {
|
||||
TODO("Kotlin repeatable annotations")
|
||||
}
|
||||
}
|
||||
|
||||
private fun wrapAnnotationEntriesInContainer(
|
||||
annotationClass: IrClass,
|
||||
containerClass: IrClass,
|
||||
entries: List<IrConstructorCall>,
|
||||
): IrConstructorCall {
|
||||
val annotationType = annotationClass.typeWith()
|
||||
return IrConstructorCallImpl.fromSymbolOwner(containerClass.defaultType, containerClass.primaryConstructor!!.symbol).apply {
|
||||
putValueArgument(
|
||||
0,
|
||||
IrVarargImpl(
|
||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
||||
context.irBuiltIns.arrayClass.typeWith(annotationType),
|
||||
annotationType,
|
||||
entries
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Generated
+27
-9
@@ -2101,21 +2101,39 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaRepeatable.kt")
|
||||
public void testJavaRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_5.kt")
|
||||
public void testJavaRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable.kt")
|
||||
public void testJavaUnrepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_6.kt")
|
||||
public void testJavaRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable.kt")
|
||||
public void testKotlinRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt");
|
||||
@TestMetadata("javaUnrepeatable_1_5.kt")
|
||||
public void testJavaUnrepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable_1_6.kt")
|
||||
public void testJavaUnrepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_5.kt")
|
||||
public void testKotlinRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_6.kt")
|
||||
public void testKotlinRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_6.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -436,6 +436,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Repeatable {
|
||||
@Test
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+10
@@ -423,6 +423,16 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
||||
public void testUnsignedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeListing/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Repeatable {
|
||||
@Test
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+22
@@ -496,6 +496,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Repeatable {
|
||||
@Test
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaAnnotation.kt")
|
||||
public void testJavaAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/repeatable/javaAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmRepeatableKotlinAnnotation.kt")
|
||||
public void testJvmRepeatableKotlinAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/annotations/repeatable/jvmRepeatableKotlinAnnotation.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+22
@@ -423,6 +423,28 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
||||
public void testUnsignedTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/annotations/unsignedTypes.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/bytecodeListing/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Repeatable {
|
||||
@Test
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaAnnotation.kt")
|
||||
public void testJavaAnnotation() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/annotations/repeatable/javaAnnotation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonRepeatedAnnotationWithItsContainer.kt")
|
||||
public void testNonRepeatedAnnotationWithItsContainer() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeListing/annotations/repeatable/nonRepeatedAnnotationWithItsContainer.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+13
@@ -391,6 +391,19 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Repeatable extends AbstractLightAnalysisModeTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
+27
-9
@@ -2095,21 +2095,39 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaRepeatable.kt")
|
||||
public void testJavaRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_5.kt")
|
||||
public void testJavaRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable.kt")
|
||||
public void testJavaUnrepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable.kt");
|
||||
@TestMetadata("javaRepeatable_1_6.kt")
|
||||
public void testJavaRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable.kt")
|
||||
public void testKotlinRepeatable() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable.kt");
|
||||
@TestMetadata("javaUnrepeatable_1_5.kt")
|
||||
public void testJavaUnrepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaUnrepeatable_1_6.kt")
|
||||
public void testJavaUnrepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaUnrepeatable_1_6.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_5.kt")
|
||||
public void testKotlinRepeatable_1_5() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_5.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kotlinRepeatable_1_6.kt")
|
||||
public void testKotlinRepeatable_1_6() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/kotlinRepeatable_1_6.kt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+13
@@ -106,6 +106,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Repeatable extends AbstractIrJsCodegenBoxES6Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+13
@@ -106,6 +106,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Repeatable extends AbstractIrJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Generated
+13
@@ -106,6 +106,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Repeatable extends AbstractJsCodegenBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+13
@@ -101,6 +101,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/repeatable")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Repeatable extends AbstractIrCodegenBoxWasmTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRepeatable() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/repeatable"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user