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

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Fri Nov 24 16:06:26 UTC 2017


+1

-Sundar

On 24/11/17, 7:59 PM, Maurizio Cimadamore wrote:
> 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