Big Chungus
05/12/2022, 9:47 PM// annotation
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
public annotation class Showcase(
val katalog: String = "katalog"
)
// application in sources
@Showcase
fun testTarget() {}
// 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 nameJiaxiang
05/12/2022, 9:51 PMBig Chungus
05/12/2022, 9:53 PMJiaxiang
05/13/2022, 5:06 PMBig Chungus
05/13/2022, 5:19 PM