[JSR308] annotation for wildcard types

Chin Wei Ngan chinwn at comp.nus.edu.sg
Fri Feb 2 15:57:55 EST 2007


On Thu, 1 Feb 2007, Neal Gafter wrote:

>> to support contravariant subtyping. It is tempting to
>> think of +/- are variance annotations.
>
>
> They are variance annotations, but not in the sense of JSR175 annotations.
> The variance/wildcard syntax affects the type system and static semantics of
> the language, which is something that annotations simply do not do.

Yes, I agree with what you said. There is no point in
providing an annotation for a feature that is already in the language.

Having said that, my own understanding of JSR175 annotations is that
they can be used either statically at compile-time and/or
dynamically at runtime. Is this the general understanding?
If so, I can imagine it being used to help design the
more advanced type systems or static analysers that typically
require annotations. At least, this is the angle I am coming from.



More information about the JSR308 mailing list