RFR 8202372: Diagnostic with incorrect line info generated when compiling lambda expression

B. Blaser bsrbnd at gmail.com
Wed May 2 12:00:15 UTC 2018


Looks good!

Cheers,
Bernard

On 2 May 2018 at 13:19, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> 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