[lworld] RFR: 8273018: [lworld] Property annotation propagation to <init> lacks in primitive records [v2]
Jesper Steen Møller
jespersm at openjdk.java.net
Thu Sep 16 23:45:59 UTC 2021
On Wed, 15 Sep 2021 09:26:37 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:
>> Jesper Steen Møller has updated the pull request incrementally with one additional commit since the last revision:
>>
>> - Emit parameter names (described JDK-8273202)
>> - Keep type parameters
>> - Provide useful test for primitive records in "RecordReading"
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/TransPrimitiveClass.java line 406:
>
>> 404: init.type.getThrownTypes(),
>> 405: init.owner.type.tsym);
>> 406: factory.setAttributes(init);
>
> Again, I need some help with this change. I understand the part of parameters being carried over, but the dance around recomputation of erasure field - what exactly is the material change there ?? I can see the RecordReading test failing if I backout the changes here (except for factory.params = init.params) but need some explanation - TIA
Related to comment above: Since we're now preserving the full type information for `factoryType` and thus `factory`, instead of propagating the erased info, information from the other (preceding) lowerings would get lost. To avoid that, the erasure is explicitly reconstructed, but with a fixed return type (instead of void).
There is a different test which blows up if this isn't reconstructed, it might be `InnerValueNew.java` (I'll check later).
-------------
PR: https://git.openjdk.java.net/valhalla/pull/541
More information about the valhalla-dev
mailing list