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

Aggelos Biboudis abimpoudis at openjdk.org
Mon May 8 13:43:42 UTC 2023


> 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 with a new target base due to a merge or a rebase. The pull request now contains 44 commits:

 - Merge branch 'JDK-8300543' into unnamed
 - Reintroduce isUnnamed from VarSymbol with different name
 - Revert "Remove isUnnamed from VarSymbol"
   
   This reverts commit a46b674a5077da603c400f2005cf4a7a48d104b2.
 - Remove isUnnamed from VarSymbol
 - Remove @Override from VarSymbol.isUnnamed
 - Address comments
   
   - Annotate with Preview
   - Fix isUnnamed hierarchy
   - Flow names.empty for underscore in both model and API
   - Adjust pretty printing and annotation pretty printing
   - Fix guard bindings (great catch and thx @lahodaj!)
   - Fix TreeVisitor
   - Remove test with lambda which has a parse error from VarTree (names.empty is used to signal error)
   - Various adjustments
   
   Co-authored-by: Jan Lahoda <jan.lahoda at oracle.com>
 - 8307482: Compiler should accept var _ in nested patterns in switch case
 - Add test
 - 8307444: java.lang.AssertionError when using unnamed patterns
 - Add guard test
 - ... and 34 more: https://git.openjdk.org/jdk/compare/79bbd717...c9387a26

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

Changes: https://git.openjdk.org/jdk/pull/13528/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13528&range=18
  Stats: 1536 lines in 49 files changed: 1217 ins; 144 del; 175 mod
  Patch: https://git.openjdk.org/jdk/pull/13528.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13528/head:pull/13528

PR: https://git.openjdk.org/jdk/pull/13528


More information about the compiler-dev mailing list