RFR: 8291914: generated constructors are considered compact when they shouldn't
Jan Lahoda
jlahoda at openjdk.org
Thu Oct 20 06:16:07 UTC 2022
On Wed, 19 Oct 2022 04:52:29 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> javac is considering all record generated constructors as compact constructors. According to the spec compact constructors should be declared explicitly. This constructor is compact:
>
> record R1(int i) {
> R1 {}
> }
>
> here there is no explicit constructor so the compiler is providing one but it shouldn't be considered a compact constructor:
>
> record R2(int i) {}
>
> this PR is fixing the current compiler bug so that for declarations like record R2 the compiler generated constructor is not considered a compact one.
>
> TIA
Looks good to me.
-------------
Marked as reviewed by jlahoda (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10756
More information about the compiler-dev
mailing list