Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class AnnotationArrayValueTypeProcessor : AbstractTestProcessor() {
val argument = annotation.arguments.single()
val value = argument.value
val argumentName = argument.name?.asString()
results.add("$className $annotationName $argumentName is Array<*>: ${value is Array<*>}")
check(value is Array<*> || value is Collection<*>) {
"Unexpected array-valued annotation argument type: ${value?.javaClass?.name ?: "null"}"
}
results.add("$className $annotationName $argumentName is Array<*> or Collection<*>: true")
results.add("$className $annotationName $argumentName size: ${value.sizeOrNull()}")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ class AAConfiguredUnitTestSuite : KSPUnitTestSuite(experimentalPsiResolution = f
runTest("$AA_PATH/getSymbolsWithAnnotation/aliasedAnnotation.kt")
}

@TestMetadata("annotationArrayValueType.kt")
@Test
override fun testAnnotationArrayValueType() {
runFailingTest("$AA_PATH/annotationArrayValueType.kt")
}

@TestMetadata("allUseSiteTargetAppliedToAnnotationList.kt")
@Test
override fun testAllUseSiteTargetAppliedToAnnotationList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ abstract class KSPUnitTestSuite(
}

@Bug("https://github.com/google/ksp/issues/3008", BugState.OPEN)
abstract fun testAnnotationArrayValueType()
@TestMetadata("annotationArrayValueType.kt")
@Test
fun testAnnotationArrayValueType() {
runTest("$AA_PATH/annotationArrayValueType.kt")
}

@TestMetadata("annotationWithDefault.kt")
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ class PsiConfiguredUnitTestSuite : KSPUnitTestSuite(experimentalPsiResolution =
runFailingTest("$AA_PATH/getSymbolsWithAnnotation/aliasedAnnotation.kt")
}

@TestMetadata("annotationArrayValueType.kt")
@Test
override fun testAnnotationArrayValueType() {
runFailingTest("$AA_PATH/annotationArrayValueType.kt")
}

@TestMetadata("allUseSiteTargetAppliedToAnnotationList.kt")
@Test
override fun testAllUseSiteTargetAppliedToAnnotationList() {
Expand Down
8 changes: 4 additions & 4 deletions kotlin-analysis-api/testData/annotationArrayValueType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/
// TEST PROCESSOR: AnnotationArrayValueTypeProcessor
// EXPECTED:
// JavaAnnotated JavaAnnotation args is Array<*>: true
// JavaAnnotated JavaAnnotation args is Array<*> or Collection<*>: true
// JavaAnnotated JavaAnnotation args size: 2
// JavaAnnotated KotlinAnnotation args is Array<*>: true
// JavaAnnotated KotlinAnnotation args is Array<*> or Collection<*>: true
// JavaAnnotated KotlinAnnotation args size: 2
// KotlinAnnotated JavaAnnotation args is Array<*>: true
// KotlinAnnotated JavaAnnotation args is Array<*> or Collection<*>: true
// KotlinAnnotated JavaAnnotation args size: 2
// KotlinAnnotated KotlinAnnotation args is Array<*>: true
// KotlinAnnotated KotlinAnnotation args is Array<*> or Collection<*>: true
// KotlinAnnotated KotlinAnnotation args size: 2
// END
// FILE: JavaAnnotation.java
Expand Down
Loading