[lworld] Integrated: 8328839: [lworld] javac allows super constructor invocations before all fields have been initialized

Vicente Romero vromero at openjdk.org
Sat Mar 23 13:03:59 UTC 2024


On Sat, 23 Mar 2024 12:57:43 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> this code is being accepted by javac:
> 
> value class V {
>     int i;
> 
>     V() {
>         super();
>         i = 1;
>     }
> }
> 
> it should be rejected. Also, with value records, the implicit super call always ends up before the field stores. Reported by Tobias

This pull request has now been integrated.

Changeset: f8931fd9
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/f8931fd95193ccd5b31a6a880acfd5b523e27363
Stats:     206 lines in 8 files changed: 130 ins; 44 del; 32 mod

8328839: [lworld] javac allows super constructor invocations before all fields have been initialized

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

PR: https://git.openjdk.org/valhalla/pull/1061



More information about the valhalla-dev mailing list