Annotations can only contain static values, like p...
# getting-started
h
Annotations can only contain static values, like primitives, strings, enums or arrays. All these values are known by the compiler, so what about supporting init blocks in Kotlin annotation classes to valide the const values during compiling Kotlin code? For example, only support positive integers, required array sizes, maybe even regex validation od strings. Or is this impossible due to JVM interop?
p
https://youtrack.jetbrains.com/issue/KT-14652 https://youtrack.jetbrains.com/issue/KT-57012/ https://youtrack.jetbrains.com/issue/KT-55882/ Potentially some form of this could happen down the road, but I wouldn’t expect it anytime soon
h
Thank you for the related issues.