RFR: 8290709: Incorrect dominance error for unconditional pattern vs. null

Jan Lahoda jlahoda at openjdk.org
Thu Sep 1 12:28:15 UTC 2022


On Wed, 3 Aug 2022 16:12:55 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

> The corresponding JLS rule (3rd preview feature of pattern switch) on unconditional patterns & null does not exist anymore:
> 
> Check:
> 
> - 2nd preview: https://cr.openjdk.java.net/~gbierman/jep420/jep420-20211208/specs/patterns-switch-jls.html#jls-14.11.1
> - 3rd preview: https://cr.openjdk.java.net/~gbierman/jep427%2b405/jep427+405-20220601/specs/patterns-switch-record-patterns-jls.html#jls-14.11.1
> 
> Effectively, the following restriction was lifted:
> 
> A switch label that has a pattern case label element p that is total for the type of the selector expression of the enclosing switch statement or switch expression dominates a switch label that has a null case label element.
> 
> 
> The corresponding neg-tests where now promoted as pos-tests.

Looks good.

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

Marked as reviewed by jlahoda (Reviewer).

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


More information about the compiler-dev mailing list