Does anyone have any idea why default value for annotation argument is not being retrieved?
Copy code
// annotation
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
public annotation class Showcase(
val katalog: String = "katalog"
)
Copy code
// application in sources
@Showcase
fun testTarget() {}
Copy code
// usage in processor
private fun KSAnnotation.showcaseData(): ShowcaseVisitor.Data {
arguments.first { it.name?.getShortName() == "katalog" }.value!! as String // throws NPE
}
I'm on ksp:1.6.21-1.0.5. I've also verified that the KSAnnotation at least contains the argument by that name
j
Jiaxiang
05/12/2022, 9:51 PM
sounds like a bug to me, do you have a reproduce case?
b
Big Chungus
05/12/2022, 9:53 PM
Ah, thought so. Thanks for confirming. I'll create an issue with the reproducer tomorrow.