On Sat, 4 Oct 2025 02:40:02 GMT, Vicente Romero <[email protected]> wrote:
> implementation of [1] in valhalla. This means that code like:
>
> class Inner7 {
> private int x;
>
> public Inner7(byte y) {
> x = y; // error can't refer to an instance field before a this()
> invocation
> this((int)y);
> }
> public Inner7(int x) {
> this.x = x;
> super();
> }
> }
>
>
> won't be accepted by javac
> [1] https://bugs.openjdk.org/browse/JDK-8368719
This pull request has now been integrated.
Changeset: 274d5607
Author: Vicente Romero <[email protected]>
URL:
https://git.openjdk.org/valhalla/commit/274d56076260a490ed52df29373216617ddf73ef
Stats: 85 lines in 9 files changed: 50 ins; 16 del; 19 mod
8369062: [lworld] Do not allow references to instance fields before a this()
invocation
Reviewed-by: liach
-------------
PR: https://git.openjdk.org/valhalla/pull/1659