jean
01/27/2023, 9:03 PM@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.SOURCE)
annotation class MyAnnotation(val myArgument: Boolean = false)
...
@MyAnnotation
val someVariable1: String
@MyAnnotation(myArgument = true)
val someVariable2: String
...
When I checked the value of the argument, I get null
instead of false
val argumentValue = someVariable.annotations.first().arguments
logger.warn("${someVariable.simpleName.asString()} argumentValue: $argumentValue"")
...
w: [ksp] someVariable1 argumentValue: [myArgument:null]
w: [ksp] someVariable2 argumentValue: [myArgument:true]
Is that expected?Ting-Yuan Huang
01/27/2023, 10:19 PMJiaxiang
01/27/2023, 10:39 PMjean
01/30/2023, 7:57 AMkotlinVersion=1.8.0
kspVersion=1.8.0-1.0.8
It’s a kotlin multiplatform project but the issue occurs in a unit test on the jvm