RFR: 8302344: Compiler Implementation for Unnamed patterns and variables (Preview) [v3]

Vicente Romero vromero at openjdk.org
Thu Apr 27 15:33:25 UTC 2023


On Thu, 27 Apr 2023 14:16:30 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> This PR implements [JEP 443](https://openjdk.org/jeps/443), the preview feature for Unnamed Patterns and Variables in Java.
>> 
>> Draft Spec: https://cr.openjdk.org/~abimpoudis/unnamed/latest/
>
> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address javax.lang.model comments

src/jdk.compiler/share/classes/com/sun/source/tree/AnyPatternTree.java line 2:

> 1: /*
> 2:  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.

nit: copy year should be 2023? new file

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Flags.java line 278:

> 276: 
> 277:     /**
> 278:      * Flag that indicates that a local variable, a lambda parameter, or an unnamed pattern variable is unnamed.

question: cant we infer this from the name itself instead of consuming a flag?

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java line 215:

> 213:             //When real preview features will be added, this method can be implemented to return 'true'
> 214:             //for those selected features, and 'false' for all the others.
> 215:             case UNNAMED_VARIABLES -> true;

the comment above should apply to the default case I think

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1179247824
PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1179251556
PR Review Comment: https://git.openjdk.org/jdk/pull/13528#discussion_r1179252709


More information about the kulla-dev mailing list