RFR: JEP 359-Records: compiler code

Srikanth srikanth.adayapalam at oracle.com
Thu Oct 31 03:41:09 UTC 2019



On 30/10/19 11:37 PM, Vicente Romero wrote:
> (12) Compact constructor trees are modified in in 
> com.sun.tools.javac.parser.JavacParser#recordDeclaration to become 
> elaborated tree - I thought this practice of modifying parse trees in 
> the early stages is frowned upon ?? (Other parse tree transformations 
> also happen here)
>
> right but no other feature allows to declare a parameter-less method. 
> If not expanded here the compact constructor would have to be expanded 
> in TypeEnter, which probably is not very nice either, so I didn't see 
> a perfect solution

It may be quite a bit of work, but the canonical solution would be to 
introduce a new node type to model these. Not asking it to be done. Just 
saying.

Srikanth



More information about the compiler-dev mailing list