RFR: 8336492: Regression in lambda serialization [v10]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Jul 30 08:27:39 UTC 2024
On Mon, 29 Jul 2024 20:47:38 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix more cases where EnclosingMethodAttribute is wrong for lambdas declared in instance field inits
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java line 831:
>
>> 829:
>> 830: private MethodType typeToMethodType(Type mt) {
>> 831: Type type = types.erasure(mt);
>
> nit: not part of your patch but I think that `mt` should already be erased at this point, now that Lower is running before L2M
I don't think so - I see it used here:
MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.target.tsym);
List<LoadableConstant> staticArgs = List.of(
typeToMethodType(samSym.type),
refSym.asHandle(),
typeToMethodType(tree.getDescriptorType(types)));
I think neither `samSym.type` nor the result of `tree::getDescriptorType` (which is based on `tree.target`) are erased.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20349#discussion_r1696544601
More information about the compiler-dev
mailing list