<div dir="ltr"><div dir="ltr">On Thu, Feb 16, 2023 at 3:01 PM Alex Buckley <<a href="mailto:alex.buckley@oracle.com">alex.buckley@oracle.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In contrast, you are applying `@A` to a declaration, `class B {}`. Your <br>
application of `@A` is legal - it is a _declaration annotation_ -- because:<br>
<br>
A declaration annotation is ... an annotation that applies to a class,<br>
interface, or type parameter declaration, and whose annotation<br>
interface is applicable in type contexts (§4.11).<br>
<br>
That is, `A` being applicable in type contexts means `@A` can be applied <br>
very, very widely.<br></blockquote><div><br></div><div>Thank you for the explanation, I think I understand now. TYPE_USE is in pragmatic terms a superset of some other ElementTypes (such as TYPE; maybe others; haven't thought it through) given that annotations so annotated can be applied not just in type contexts but in (some? probably not all?) declaration contexts as well. There is, in other words (check me on this?), no effective difference at all between @Target({ ElementType.TYPE, ElementType.TYPE_USE }) and @Target({ ElementType.TYPE_USE }).</div><div><br></div><div>L</div></div></div>