[JSR308] annotations on arrays
Neal Gafter
gafter at google.com
Thu Feb 1 18:39:07 EST 2007
On 2/1/07, Chin Wei Ngan <chinwn at comp.nus.edu.sg> wrote:
>
>
>
> On Thu, 1 Feb 2007, Neal Gafter wrote:
>
> > The dimensions of an array type are not part of the array type in Java
> (all
> > arrays are indexing using int, and the bounds of the array are not part
> of
> > the type), so I see annotating the "dimensions" as being somewhat out of
> > scope for the JSR. At best an annotation on the array type could give
> some
> > information about the values that can be used to index arrays of that
> type.
> > It could be in scope if we open the scope of the JSR to include more of
> the
> > semantically meaningful nonterminals than just types.
>
> I have a slightly different view on this. If we view array as
> a composite type, the bounds of arrays are in fact "int" field
> of array object. Hence, bound/dimension _is_ a component of the
> type of array. The only difference is that bound is always an
> int type in Java, so there is no need to explicitly re-declare it.
> That is Java is silent on this bound type in its syntax.
Even if I accept your premise, the conclusion doesn't follow. I can
annotate a use of the type String, but that doesn't mean I get to say
anything about the members of String at the site where String is mentioned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/pipermail/jsr308/attachments/20070201/81be8018/attachment.htm
More information about the JSR308
mailing list