spec clarification: wildcard array element signature
Alex Buckley
alex.buckley at oracle.com
Wed Nov 2 21:28:35 UTC 2016
On 10/22/2016 8:15 PM, Liam Miller-Cushon wrote:
> When javac compiles the following program, it writes field i's signature
> as "LA<[*>.I;".
>
> I don't think the grammar in JVMS 4.7.9.1 allows for the element type of
> an array to be a wildcard. Is that a spec bug?
>
> class A<X> { class I {} }
> class Test {
> class B<Y> extends A<Y[]> {}
> B<?>.I i;
> }
Liam, are you calling Field.getGenericType() on i and getting a
surprising result, perhaps a ParameterizedType whose
getActualTypeArguments() blows up?
Alex
More information about the compiler-dev
mailing list