RFR 8191834: Assigning a void expression to a "var" crashes the compiler
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Nov 24 16:16:44 UTC 2017
Pushed, thx!
Maurizio
On 24/11/17 16:06, Sundararajan Athijegannathan wrote:
> +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