RFR 8202372: Diagnostic with incorrect line info generated when compiling lambda expression
Vicente Romero
vicente.romero at oracle.com
Wed May 2 13:16:13 UTC 2018
looks good,
Vicente
On 05/02/2018 07:19 AM, Maurizio Cimadamore wrote:
> Hi,
> I put together a webrev based on the fix that B. Blaser put together
> few days ago. I've enhanced the test as I realized that the erroneous
> condition could present in multiple situations (the patch seems to fix
> all of them).
>
> The underlying issue is that when we create a fake block for the
> lambda expression (which is needed for speculatively check its
> contents), we forget setting its position - meaning that all diags
> reported against the rewritten block will now appear off sync.
>
> One solution would be to tweak the code to never use speculative trees
> to report diagnostic - but that would be very invasive; a cheaper fix
> (the one attempted here) is to add the required positional info to the
> rewritten tree so that it matches the original position.
>
> http://cr.openjdk.java.net/~mcimadamore/8202372/
>
> Cheers
> Maurizio
>
More information about the compiler-dev
mailing list