Suppose we have a Java annotation as follows:
@Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Hans { String[] value() default {}; }
In Kotlin, I am allowed to use the annotation as follows:
@Hans(value = "test")
Once I changed the property name from 'value' to 'name', he is no longer allowed to use this syntax, instead I need to have arrayOf (..).
@Hans(name = arrayOf("test"))
Is this a mistake or a design decision, and if so, what is the reason for this.
Thanks a lot in advance Regards
kotlin
Raffael schmid
source share