I'm trying to create an annotation in which i want to pass an array of "other" annotations, but i don't know types of those ahead. Basically i want user to pass whatever annotations they want there. From docs i read that i can use other annotations as a parameter of annotation. I can do
annotation class MyAnnotation(val list: Array<OtherKnownAnnotation>)
. There is a interface called
Annotation
that is
Base interface implicitly implemented by all annotation interfaces.
. So i tried to do
annotation class MyAnnotation(val list: Array<Annotation>)
. This unfortunately gives me an error
Invalid type of annotation member
. Can i work around this? Anybody had a usecase like this?