RFR: 8273263: Incorrect recovery attribution of record component type when j.l.Record is unavailable
Vicente Romero
vromero at openjdk.java.net
Thu Sep 2 17:53:15 UTC 2021
On Thu, 2 Sep 2021 10:54:14 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> This is a little obscure case where `j.l.Record` is not available, yet the source code contains a record, the AST model is slightly broken - the first record's component has an erroneous type. The reason is that `syms.recordType` is used directly, and when it is completed (for the first time), the `CompletionFailure` thrown will break the component's type. It would be better to report the error on the proper place at a proper place. This is already done for enums, where the supertype is attributed from an AST, which reports any errors at an appropriate place. The proposal in this patch is to also create a temporary AST for `j.l.Record` and attribute it, so that the errors are reported at an appropriate time and place.
looks good
-------------
Marked as reviewed by vromero (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5349
More information about the compiler-dev
mailing list