Hi,
Thanks Mike for answering my previous question, I'm actually working on this implementation for the Eclipse Compiler (resurrecting a patch from a while ago).
I had another quick question, I'm trying to determine whether I need a type path in a certain situation.
I compile two statements:
Object o = new @A String[1];
Object o = new String @A[1];
with javac build 81 (or seemingly with the latest jsr308 lang tools, if I'm using them correctly), I get the same output attribute:
I think I expected the first one to have a type path:
0: #15(): NEW, offset=8, location=[ARRAY]
I'm making this assumption based on the example later in the spec:
@I String @F[] @G[] @H
which suggests that for @F type path is empty whilst @I has a type path of [ARRAY,ARRAY,ARRAY] (i.e. skip over the array components), and on what happens in other places when I use (@A String []).
is new special? am I just getting confused? I seem to be going into areas where I can't quite trust javac now (I know b81 is a little old).
many thanks,
Andy
---
Andy Clement
VMware
ps. maybe the second byte of the type path entry for 'deeper in array' could indicate how much deeper into the array (similarly for deeper in nested type). Use two of them if going deeper than 255 levels in the array but if you have arrays that deep you probably have other problems :) Not sure how much you care about saving a few bytes here and there...