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

Vicente Romero vromero at openjdk.org
Mon Oct 28 15:17:55 UTC 2024


On Wed, 16 Oct 2024 14:18:44 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

> 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`.

test/langtools/tools/javac/patterns/PrimitiveTypesInTestingContextErasure.java line 30:

> 28:  * @summary Compiler Implementation for Primitive types in patterns, instanceof, and switch (Second Preview)
> 29:  * @enablePreview
> 30:  * @compile PrimitiveTypesInTestingContextErasure.java

I don't think you need the `@compile` and the `@run` commands `@enablePreview` should be enough

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21539#discussion_r1819239416


More information about the compiler-dev mailing list