[lworld] RFR: 8369062: [lworld] Do not allow references to instance fields before a this() invocation [v2]

Vicente Romero vromero at openjdk.org
Sun Oct 5 13:50:53 UTC 2025


> 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

Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:

  addressing review comments

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1659/files
  - new: https://git.openjdk.org/valhalla/pull/1659/files/bdd8be33..31671163

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1659&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1659&range=00-01

  Stats: 26 lines in 4 files changed: 10 ins; 11 del; 5 mod
  Patch: https://git.openjdk.org/valhalla/pull/1659.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1659/head:pull/1659

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


More information about the valhalla-dev mailing list