RFR: JDK-8234445: spurious error message for record constructors with receiver parameters
Vicente Romero
vicente.romero at oracle.com
Thu Dec 19 16:03:22 UTC 2019
ping
On 12/18/19 1:24 PM, Vicente Romero wrote:
> Please review the fix for [1] at [2]. What happens here is that
> basically for records we are altering the order in which members are
> entered, this is because the compiler needs to check if a user
> provided constructor has the same erasure as the canonical constructor
> or not and depending on this generate one or not, or even issue an
> error. The only way to have access to this information is to enter all
> the constructors before the compiler gets to the point where it needs
> to decide if a canonical should be generated or not. The current
> implementation 'forgot' to add `this` and `super` to the scope before
> entering all the constructors. This is the reason for the spurious
> error message: because `this` was not entered before the user defined
> constructors were entered by the compiler
>
> Thanks,
> Vicente
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8234445
> [2] http://cr.openjdk.java.net/~vromero/8234445/webrev.00/
More information about the compiler-dev
mailing list