JDK 10/11 RFR of JDK-8189146: Have use of "var" in 9 and earlier source versions issue a warning
joe darcy
joe.darcy at oracle.com
Fri Jan 12 19:59:03 UTC 2018
PS Link to webrev below.
On 1/12/2018 11:13 AM, joe darcy wrote:
> Hi Maurizio,
>
>
>
[snip]
>
>>
>> I believe what comes out of the compiler is in sync with what you
>> wanted, but the patch is not as trivial as we originally had hoped,
>> which, in my mind, makes it more for 11 than for 10.
>
> Hmm. I agree the current patch is more intricate than desired for this
> stage of JDK 10.
>
> Arguably the largest compatibility impact from var is no longer being
> able to use var as a type name, at least it is the impact that might
> be hardest to overcome in terms of having to rename a type rather than
> rename a variable. So for a patch appropriate for 10 at this stage,
> I'll prepare a simple patch for consideration that just warns on type
> name. Then if that is acceptable for 10, your patch could go into JDK
> 11 under a follow-up bug.
>
The iteration at
http://cr.openjdk.java.net/~darcy/8189146.4/
goes back to the initial limited attempt at only warning for type names
(which also covers type variables) but preserves the more precise
testing developed in subsequent iterations.
Thanks,
-Joe
More information about the compiler-dev
mailing list