Is a TYPE_USE annotation stored as such in a class file?
Alex Buckley
alex.buckley at oracle.com
Thu Feb 16 22:43:22 UTC 2023
On 2/16/2023 2:33 PM, Laird Nelson wrote:
> On Thu, Feb 16, 2023 at 1:59 PM Liam Miller-Cushon <cushon at google.com
> <mailto:cushon at google.com>> wrote:
>
> I think this is deliberate and covered by
> https://docs.oracle.com/javase/specs/jls/se19/html/jls-9.html#jls-9.7.4 <https://docs.oracle.com/javase/specs/jls/se19/html/jls-9.html#jls-9.7.4>
>
> A declaration annotation is ... an annotation that applies to a
> class, interface, or type parameter declaration, and whose
> annotation interface is applicable in type contexts
>
>
> But @A does not have ElementType.TYPE which is what I take to be the
> manifestation of “applicable in type contexts”. Maybe I’m wrong?
The annotation interface A has ElementType.TYPE_USE === applicable in
type contexts (9.6.4.1).
Alex
More information about the compiler-dev
mailing list