RFR: 8273408: java.lang.AssertionError: typeSig ERROR on generated class property of record [v2]

Vicente Romero vromero at openjdk.java.net
Wed Sep 15 14:37:46 UTC 2021


On Wed, 15 Sep 2021 06:10:27 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> After processing annotation, if new source files are generated, the compiler should re-parse and re-enter the source files so that the type and symbol can keep right. The compiler always holds this convention in the past. But when the feature `record` is added, the convention is broken. In this bug, the compiler doesn't  catch or enter the new/good type for record component after processing annotation. So some issues may occur at the later phases.
>> 
>> This patch fixes the type of the record component so that the phases `Gen` and `ClassWriter` can get the right type. And a test case is added.
>> 
>> Thanks for taking the time to review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Treat source as comment mistakenly. Remove the comment symbol.

I think that there are two test cases missing here. I think that you should investigate the interaction of your patch with something like:


record R(unknownType t) {}


and see what happens, if your code creates another record component when I think it shouldn't, etc. Actually you could try to override the type in the existing record component instead of creating a new one.

Another investigation you should do is how your code interacts with annotations (declaration and type anotations) on the record component. So in your test add annotations to the record component and see if you need to copy them etc. I think that if you override the type of the record component instead of creating a new one you should be fine with annotations, but not sure TBH

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

PR: https://git.openjdk.java.net/jdk/pull/5511


More information about the compiler-dev mailing list