[FIR] Support typealiases to java Repeatable
This commit is contained in:
committed by
Space Team
parent
2e8b177262
commit
d105ce8681
+6
@@ -2371,6 +2371,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaRepeatableInKotlin.kt")
|
||||||
|
public void testJavaRepeatableInKotlin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatableInKotlin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
||||||
public void testJavaRepeatableJvmTarget6() throws Exception {
|
public void testJavaRepeatableJvmTarget6() throws Exception {
|
||||||
|
|||||||
+6
@@ -2377,6 +2377,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaRepeatableInKotlin.kt")
|
||||||
|
public void testJavaRepeatableInKotlin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatableInKotlin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
||||||
public void testJavaRepeatableJvmTarget6() throws Exception {
|
public void testJavaRepeatableJvmTarget6() throws Exception {
|
||||||
|
|||||||
+6
@@ -2371,6 +2371,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaRepeatableInKotlin.kt")
|
||||||
|
public void testJavaRepeatableInKotlin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatableInKotlin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
||||||
public void testJavaRepeatableJvmTarget6() throws Exception {
|
public void testJavaRepeatableJvmTarget6() throws Exception {
|
||||||
|
|||||||
+2
-2
@@ -87,11 +87,11 @@ object FirRepeatableAnnotationChecker : FirBasicDeclarationChecker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (declaration is FirRegularClass) {
|
if (declaration is FirRegularClass) {
|
||||||
val javaRepeatable = annotations.find { it.unexpandedClassId == StandardClassIds.Annotations.Java.Repeatable }
|
val javaRepeatable = annotations.getAnnotationByClassId(StandardClassIds.Annotations.Java.Repeatable, session)
|
||||||
if (javaRepeatable != null) {
|
if (javaRepeatable != null) {
|
||||||
checkJavaRepeatableAnnotationDeclaration(javaRepeatable, declaration, context, reporter)
|
checkJavaRepeatableAnnotationDeclaration(javaRepeatable, declaration, context, reporter)
|
||||||
} else {
|
} else {
|
||||||
val kotlinRepeatable = annotations.find { it.toAnnotationClassId(session) == StandardClassIds.Annotations.Repeatable }
|
val kotlinRepeatable = annotations.getAnnotationByClassId(StandardClassIds.Annotations.Repeatable, session)
|
||||||
if (kotlinRepeatable != null) {
|
if (kotlinRepeatable != null) {
|
||||||
checkKotlinRepeatableAnnotationDeclaration(kotlinRepeatable, declaration, context, reporter)
|
checkKotlinRepeatableAnnotationDeclaration(kotlinRepeatable, declaration, context, reporter)
|
||||||
}
|
}
|
||||||
|
|||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// FULL_JDK
|
||||||
|
// !LANGUAGE: +RepeatableAnnotations
|
||||||
|
|
||||||
|
//import java.lang.annotation.*
|
||||||
|
|
||||||
|
typealias Rep = java.lang.annotation.Repeatable
|
||||||
|
|
||||||
|
<!REPEATABLE_CONTAINER_MUST_HAVE_VALUE_ARRAY_ERROR!>@Rep(RepeatableAnnotationContainer::class)<!>
|
||||||
|
annotation class RepeatableAnnotation
|
||||||
|
annotation class RepeatableAnnotationContainer
|
||||||
|
|
||||||
|
@RepeatableAnnotation class Annotated
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
@RepeatableAnnotation public final class Annotated {
|
||||||
|
public constructor Annotated()
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
@Rep /* = java.lang.annotation.Repeatable */(value = RepeatableAnnotationContainer::class) public final annotation class RepeatableAnnotation : kotlin.Annotation {
|
||||||
|
public constructor RepeatableAnnotation()
|
||||||
|
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 RepeatableAnnotationContainer : kotlin.Annotation {
|
||||||
|
public constructor RepeatableAnnotationContainer()
|
||||||
|
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 typealias Rep = java.lang.annotation.Repeatable
|
||||||
|
|
||||||
Generated
+6
@@ -2377,6 +2377,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/containerTarget_1_6.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("javaRepeatableInKotlin.kt")
|
||||||
|
public void testJavaRepeatableInKotlin() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/annotations/repeatable/javaRepeatableInKotlin.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
@TestMetadata("javaRepeatableJvmTarget6.kt")
|
||||||
public void testJavaRepeatableJvmTarget6() throws Exception {
|
public void testJavaRepeatableJvmTarget6() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user