RFR: 8271928: ErroneousTree with start position -1

Jim Laskey jlaskey at openjdk.java.net
Thu Aug 5 11:49:32 UTC 2021

On Thu, 5 Aug 2021 11:30:50 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> For some (very) erroneous code, the javac's parser may create an `ErroneousTree`, which contains an empty `ModifiersTree`. The empty `ModifiersTree` will not have the position, set but the `ModifiersTree`'s position will be used as the start position of the `ErroneousTree`, leading to start position `-1`. The proposal is to fall back on the the `ErroneousTree`'s `pos` when the nested tree does not have any position set.

Marked as reviewed by jlaskey (Reviewer).


PR: https://git.openjdk.java.net/jdk/pull/5018

More information about the compiler-dev mailing list