RFR: 8335159: Move method reference to lambda desugaring before Lower [v2]
Andrey Turbanov
aturbanov at openjdk.org
Tue Jul 9 20:05:18 UTC 2024
On Thu, 27 Jun 2024 10:03:23 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 incrementally with one additional commit since the last revision:
>
> Address review comment
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java line 629:
> 627: */
> 628: boolean isPrivateInOtherClass(JCMemberReference tree) {
> 629: return (tree.sym.flags() & PRIVATE) != 0 &&
Suggestion:
return (tree.sym.flags() & PRIVATE) != 0 &&
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19903#discussion_r1671163465
More information about the compiler-dev
mailing list