On Wed, 24 Jan 2024 11:53:52 GMT, Aggelos Biboudis <abimpou...@openjdk.org> wrote:
>> This is the proposed patch for Primitive types in patterns, instanceof, and >> switch (Preview). >> >> Draft spec here: https://cr.openjdk.org/~abimpoudis/instanceof/latest/ > > Aggelos Biboudis has updated the pull request incrementally with one > additional commit since the last revision: > > Set previewEnabled properly in SwitchBootstraps src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java line 2962: > 2960: * More rewritings: > 2961: * > 2962: * - If the `instanceof` check is unconditionally exact rewrite to > true. Note: the same effect can be obtained, w/o rewriting (and perhaps more simply) by detecting the case of an unconditionally exact "instanceof" test, and giving the instanceof expression a constant boolean type (with value "true"). This can be done in Attr. Then, `Gen` will shortcircuit the expression, as required. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15638#discussion_r1464857684