ReferenceType in CastExpression productions
Srikanth S Adayapalam
srikanth_sankaran at in.ibm.com
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
ReferenceType
in different chapters: one that includes arrays and one that doesn't. We
said
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:
// ----
import java.io.serializeable;
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.
Srikanth.
More information about the lambda-spec-observers
mailing list