Does anyone have any idea why default value for an...
# ksp
b
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
sounds like a bug to me, do you have a reproduce case?
b
Ah, thought so. Thanks for confirming. I'll create an issue with the reproducer tomorrow.
🙏 1
There you go #987
Managed to further isolate the issue while preparing a reproducer
👍 1
j
Actually it is the same issue as #885, initially I thought it is also failing for JVM therefore thinking it might be a new issue.
b
Even better!