Error in grammer
Brought to you by:
nfortescue
Pizza is unable to correctly parse the following code:
...
Object x = Array.newInstance(int[].class, 1);
...
The problem is the use of the .class reflection field
on an array type, which fails somewhere in "term4" I
think.
It should be fairly easy to change the Parser, but I
don't have the time right now.
I have checked that the JDK correctly parses it.
Logged In: YES
user_id=251678
OK. Just checked this with the relevant bit of the Java
Language Specification. For those interested, page 328, in
my copy, section 15.8.2, "A class literal is an expression
consiting of the name of a class, interface, array or
primitive type followed by a '.' and token class.
So this is definitely required syntax. I'll add a test case
and look at adding it.