ReferenceType in CastExpression productions

Srikanth S Adayapalam srikanth_sankaran at
Tue Feb 12 06:36:47 PST 2013

A while ago, in the context of the method/constructor reference expression
grammar changes, it was pointed out that JLS7 has two definitions of 
in different chapters: one that includes arrays and one that doesn't. We 
that the one that includes arrays is the right one to use for parsers.

It appears that this split-personality could be influencing 8b74's 
behavior in
rejecting the snippet below:

// ----
public class X {
    X [] x = (X[] & Serializable & Cloneable) new X[0];  // error: 
unexpected type, required class, found X[]

I cannot think of a non-pedantic case where this should matter, calling it 
out just the same in case I missed
some subtleties.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the lambda-spec-experts mailing list