RFR: 8341408: Implement JEP 488: Primitive Types in Patterns, instanceof, and switch (Second Preview)

Aggelos Biboudis abimpoudis at openjdk.org
Mon Oct 21 15:34:48 UTC 2024


This PR prepares the improvement for JEP 488.

The proposed approach is described in the CSR.

In terms of compiler implementation, we add the related translation in `TransPatterns`. Interestingly, this issue would be ideally addressed in `TransTypes`. However, there are some conveniences in `TransPatterns` that would need to be pulled into `TransTypes` to make this work: 1) the dependency to `makeBinary` and transitively to `operators` and 2) a lot of ceremony around `currentMethodSym` is already setup nicely in `TransPatterns`.

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

Commit messages:
 - 8341408: Implement JEP 488: Primitive Types in Patterns, instanceof, and switch (Second Preview)

Changes: https://git.openjdk.org/jdk/pull/21539/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21539&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341408
  Stats: 139 lines in 4 files changed: 133 ins; 3 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/21539.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21539/head:pull/21539

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


More information about the compiler-dev mailing list