From a42aae256d3c3607947e81a4eb59adbf3398f9fb Mon Sep 17 00:00:00 2001 From: Kuan-Ying Chou Date: Fri, 16 Aug 2024 18:36:21 +0100 Subject: [PATCH] Test fqn of nested annotations (cherry picked from commit dfe706dea74da9998687d631a3ad76e740878468) --- .../testData/annotationValue/annotationValue_java.kt | 10 ++++++++-- test-utils/testData/api/annotationValue_java.kt | 11 +++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/kotlin-analysis-api/testData/annotationValue/annotationValue_java.kt b/kotlin-analysis-api/testData/annotationValue/annotationValue_java.kt index b309f04071..ba58cb03a8 100644 --- a/kotlin-analysis-api/testData/annotationValue/annotationValue_java.kt +++ b/kotlin-analysis-api/testData/annotationValue/annotationValue_java.kt @@ -21,9 +21,11 @@ // MyClass: MyAnnotation: stringParam = 2 // MyClass: MyAnnotation: stringParam2 = 1 // MyClass: MyAnnotation: stringArrayParam = [3, 5, 7] +// MyClass: MyAnnotation: Containing.Nested // MyClassInLib: MyAnnotation: stringParam = 2 // MyClassInLib: MyAnnotation: stringParam2 = 1 // MyClassInLib: MyAnnotation: stringArrayParam = [3, 5, 7] +// MyClassInLib: MyAnnotation: Containing.Nested // Str // 42 // Foo @@ -60,8 +62,12 @@ import java.lang.annotation.Target; int value1(); } +@interface Containing { + @interface Nested {} +} + interface MyInterface {} -@MyAnnotation(stringParam = "2") class MyClassInLib implements MyInterface {} +@MyAnnotation(stringParam = "2") @Containing.Nested class MyClassInLib implements MyInterface {} // FILE: OtherAnnotation.java import java.lang.annotation.Retention; @@ -80,7 +86,7 @@ annotation class KotlinAnnotationWithDefaults(val otherAnnotation: OtherAnnotati // MODULE: main(module1) // FILE: Test.java -@MyAnnotation(stringParam = "2") class MyClass implements MyInterface {} +@MyAnnotation(stringParam = "2") @Containing.Nested class MyClass implements MyInterface {} // FILE: a.kt enum class RGB { diff --git a/test-utils/testData/api/annotationValue_java.kt b/test-utils/testData/api/annotationValue_java.kt index bd820137a7..875b7e0d5d 100644 --- a/test-utils/testData/api/annotationValue_java.kt +++ b/test-utils/testData/api/annotationValue_java.kt @@ -21,9 +21,11 @@ // MyClass: MyAnnotation: stringParam = 2 // MyClass: MyAnnotation: stringParam2 = 1 // MyClass: MyAnnotation: stringArrayParam = [3, 5, 7] +// MyClass: MyAnnotation: Containing.Nested // MyClassInLib: MyAnnotation: stringParam = 2 // MyClassInLib: MyAnnotation: stringParam2 = 1 // MyClassInLib: MyAnnotation: stringArrayParam = [3, 5, 7] +// MyClassInLib: MyAnnotation: Containing.Nested // Str // 42 // Foo @@ -50,8 +52,13 @@ import java.lang.annotation.Target; String stringParam2() default "1"; String[] stringArrayParam() default {"3", "5", "7"}; } + +@interface Containing { + @interface Nested {} +} + interface MyInterface {} -@MyAnnotation(stringParam = "2") class MyClassInLib implements MyInterface {} +@MyAnnotation(stringParam = "2") @Containing.Nested class MyClassInLib implements MyInterface {} // FILE: OtherAnnotation.java import java.lang.annotation.Retention; @@ -67,7 +74,7 @@ public @interface JavaAnnotationWithDefaults { // MODULE: main(module1) // FILE: Test.java -@MyAnnotation(stringParam = "2") class MyClass implements MyInterface {} +@MyAnnotation(stringParam = "2") @Containing.Nested class MyClass implements MyInterface {} // FILE: a.kt enum class RGB {