[lworld] RFR: 8370635: [lworld] TypeName.super.[TypeArguments] Identifier cannot occur in prologue

Vicente Romero vromero at openjdk.org
Tue Dec 9 02:44:32 UTC 2025


Code like:

class Test {
    static boolean testMethod() { return true; }
    Test() {}
    Test(int a) {
        Test.this.testMethod();
        this();
    }
}


or:


class Super {
    static <T> void m() {}
}

class Test extends Super {
    Test() {
        Test.super.<String>m();
        super();
    }
}


shouldn't be allowed in prologue. Javac was not checking static method invocations in the prologue correctly. This fix should solve this issue,

TIA

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

Commit messages:
 - updates
 - Merge branch 'lworld' into JDK-8370635
 - 8370635: [lworld] TypeName.super.[TypeArguments] Identifier cannot occur in prologue

Changes: https://git.openjdk.org/valhalla/pull/1779/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1779&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8370635
  Stats: 31 lines in 4 files changed: 27 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/valhalla/pull/1779.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1779/head:pull/1779

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


More information about the valhalla-dev mailing list