question about diamond spec

Alex Buckley alex.buckley at
Fri Sep 6 10:12:30 PDT 2013

Hi Vicente,

The JLS specifies only that a compile-time error occurs; it says nothing 
about diagnostics accompanying the error.


On 9/6/2013 2:33 AM, Vicente-Arturo Romero-Zaldivar wrote:
> Hi Alex,
> We have been working with a javac crash [1]. The underlying reason for
> the crash is the different diagnostic reports we have in javac for
> constructor invocations using diamond expressions compared to those with
> type arguments:
> List<String> l = new ArrayList<>();              goes through a path
> different to:
> List<String> l = new ArrayList<String>();
> I assume this is to provide more detailed, user friendly, error
> diagnostics in case a diamond expression can't be applied, but I would
> like to know if there is a specific specification issue that justify
> this approach.
> We would like to merge the diagnostic report of both expressions as much
> as possible.
> Thanks,
> Vicente.
> [1] 8024207: javac crash in Flow$AssignAnalyzer.visitIdent

More information about the compiler-dev mailing list