RFR 8191834: Assigning a void expression to a "var" crashes the compiler

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Nov 24 14:29:46 UTC 2017


Please review this simple patch:

http://cr.openjdk.java.net/~mcimadamore/8191834/

If the type of a 'var' initializer is void, javac silently swallows it 
and then throws an error at code gen (righteously so :-)).

I tested for other edge cases such as error types, but could not 
reproduce similar failures (as in those case we never get to Gen - 
because of some error).

Cheers
Maurizio




More information about the compiler-dev mailing list