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

Chen Liang liach at openjdk.org
Mon Dec 15 19:02:27 UTC 2025


On Tue, 9 Dec 2025 02:38:06 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> 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

Sounds good, we can discuss about my case later and change if we find it necessary to change

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

Marked as reviewed by liach (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1779#pullrequestreview-3579684442


More information about the valhalla-dev mailing list