known translation issues related to JEP 482

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Jun 20 21:03:10 UTC 2024


On 20/06/2024 19:54, Archie Cobbs wrote:
> On Thu, Jun 20, 2024 at 12:04 PM Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com> wrote:
>
>>         I think that this fix, coupled with the translation fixes I
>>         shared last week should implement JEP 482 “as intended”
>>
>>     Awesome, thanks for tackling this! Fyi, I've merged this patch
>>     into my javac-pre-capture-fixes
>>     <https://urldefense.com/v3/__https://github.com/openjdk/jdk/compare/master...archiecobbs:jdk:javac-pre-capture-fixes?expand=1__;!!ACWV5N9M2RV99hQ!LNS_Z7ARnFzONoErnZklxoEZgNNqB6Z94YH73CC6lr9bNGs2ity2KjdM20yZjTgLM7aJTjO6MNMN0sLbdJaN4ojJJcfNUQ$>
>>     branch (already includes your lambda refactoring).
>
>     Let me know if that fixes all the issue we're seeing (it would be
>     great if we could collect all test cases in some github repo, so
>     that we can add to them easily).
>
> It fixes all the tests I've been running - these tests are already 
> being collected in the aforementioned github branch.
>
> And I just added a couple more, so that now all of the 
> "javac-pre-capture" issues are represented with tests, and they are 
> all passing.
Thanks for checking.
>
> So we're looking good! Let me know how you'd like to proceed and if I 
> can help in any way.

I think we need to start to roll in the patches. I think there's a 
dependency between the two translation patches I shared last week, 
whereas this latest one seems more independent.

I believe it would probably be best to start from the LambdaToMethod 
move, as that's probably the biggest change.

>
> A few housekeeping notes about the current "javac-pre-capture" branch:
>
>   * I fixed a typo in your "canRefThis" comment in Lower.java ("is" →
>     "if")
>
Thanks
>
>   * The fix for JDK-8334252 (already committed) had the wrong bug # in
>     the unit test (now fixed - does this need a separate bug?)
>
Yes, my feeling is that it would be better to file more general bugs and 
fix those, and then in the PR say that the fix also fixes the other bugs 
we know about (there's a Skara command for that, "\solves").
>
>   * We may want a new error message for the JDK-8322882 error, which
>     e.g. now reports "non-static method foo(Object) cannot be
>     referenced from a static context" for the test case even though
>     foo() is a static method.
>
Yeah, error messages are all equally bad. I think they should be 
addressed in a separate and follow up PR from the ones we discussed.

So, to recap, we need 4 issues:

1. move LambdaToMethod after Lower
2. fix Lower so that it doesn't include inaccessible enclosing instances 
in the this$xyz chain
3. fix the frontend, so that type-checking of instance creation 
expression behaves as expected
4. do a final pass on the error messages

Maurizio


> Thanks,
> -Archie
>
> -- 
> Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20240620/96ede1dc/attachment-0001.htm>


More information about the amber-dev mailing list