RFR: 8302344: Compiler Implementation for Unnamed patterns and variables (Preview) [v12]
Aggelos Biboudis
abimpoudis at openjdk.org
Thu May 4 23:28:29 UTC 2023
On Thu, 4 May 2023 21:40:38 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>>>
>>
>> In terms of pretty printing, src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java may need to be updated too.
>
>>
>
> For the user-facing javax.lang.model languages, I think the current convention of "empty name means unnamed" is reasonable and is consistent with how other unnamed items are handled in that API.
>
> I assumed for the lower-level tree API "_" would be a more appropriate choice, but I'm open to discussions alternative conventions there.
Recently, I realized that `names.empty` also signifies an error in `variableDeclaratorId` in some occasion around lambdas: https://github.com/openjdk/jdk/blob/ffae4e0e97b19b1c1ad2865ed618ba380a861b7e/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3688-L3697
I don't believe that this would be a blocker but it could pose a possible minor challenge.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1185595137
More information about the kulla-dev
mailing list