RFR: 8303374: Implement JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [v41]
Aggelos Biboudis
abimpoudis at openjdk.org
Wed Jan 24 14:58:57 UTC 2024
On Wed, 24 Jan 2024 11:50:05 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:
>> Uh, I think this is a good catch.
>>
>> I am not completely sure what the policy is, but here we are enhancing a non-preview method with some preview-based behavior. I would feel better if the method would refuse to work in the preview way when preview is not enabled. I.e. my opinion is that this should either be initialized to `jdk.internal.misc.PreviewFeatures.isEnabled()`, or `jdk.internal.misc.PreviewFeatures.ensureEnabled()` should be used appropriately.
>
> Used the `jdk.internal.misc.PreviewFeatures.isEnabled()` and remove an erroneous check in `typeSwitch`.
Addressed in https://github.com/openjdk/jdk/pull/15638/commits/663c7a54cec9ffd6ca468080f4d084e5fa4c9c3d
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1465039116
More information about the compiler-dev
mailing list