RFR: 8335159: Move method reference to lambda desugaring before Lower [v4]

Jan Lahoda jlahoda at openjdk.org
Mon Jul 15 13:27:55 UTC 2024


On Mon, 15 Jul 2024 10:03:43 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> As we recently [moved](https://github.com/openjdk/jdk/pull/19836) the translation of "simple" method references from `LambdaToMethod` to `Lower`, it became clearer that this step in fact would benefit from running even *earlier*, as it depends on the synthetic casts generated by `TransTypes` (e.g. if one or more desugared lambda parameters have a type that is either an intersection or a union type).
>> Moving the translation earlier would allow us not to *guess* which casts would need to be introduced, and just running `TransTypes::translate` on the desugaring code would take into account the type mismatches.
>
> Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Merge branch 'master' into mref_trans_types
>  - Add test for 8336320
>  - Update src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java
>    
>    Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
>  - Address review comment
>  - Initial push

test/langtools/tools/javac/SuperInit/MrefDoubleTrans.java line 36:

> 34:         }
> 35: 
> 36:         static class I {

To make the test fail without this patch:
Suggestion:

        class I {

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19903#discussion_r1677828820


More information about the compiler-dev mailing list