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

Vicente Romero vromero at openjdk.org
Mon Dec 15 19:35:38 UTC 2025


On Mon, 15 Dec 2025 18:59:15 GMT, Chen Liang <liach 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

thanks @liach for the review and approval

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

PR Comment: https://git.openjdk.org/valhalla/pull/1779#issuecomment-3657261448


More information about the valhalla-dev mailing list