RFR: 8271928: ErroneousTree with start position -1

Vicente Romero vromero at openjdk.java.net
Thu Aug 5 17:04:30 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 vromero (Reviewer).

looks good

-------------

PR: https://git.openjdk.java.net/jdk/pull/5018Marked as reviewed by vromero (Reviewer).


More information about the compiler-dev mailing list