I'm having some trouble picking up annotations on ...
# compiler
a
I'm having some trouble picking up annotations on a type in the backend IR. I've got something like:
Copy code
fun <R> filter(p: (@SpecialValue Person) -> R)
...
filter(p -> p.name)
I've got the IrGetValue expression for
p
in
p.name
but when I check
expression.type.annotations
it's empty. I know it's the right type because
expression.type
is
my.stuff.Person
which is the right class but the annotation
@SpecialValue
is just not there. Why has it disappeared from the type? Can I get it somehow?
Oh shoot... it was
Copy code
@Retention(AnnotationRetention.SOURCE)
so I guess that's why it disappeared. I changed it to
AnnotationRetention.BINARY
and I see the annotation in the types list now. Is that expected behavior?