RFR: 8290709: Incorrect dominance error for unconditional pattern vs. null
Aggelos Biboudis
abimpoudis at openjdk.org
Wed Aug 3 16:18:18 UTC 2022
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.
-------------
Commit messages:
- 8290709: Incorrect dominance error for unconditional pattern vs. null
Changes: https://git.openjdk.org/jdk/pull/9732/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9732&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8290709
Stats: 66 lines in 6 files changed: 25 ins; 20 del; 21 mod
Patch: https://git.openjdk.org/jdk/pull/9732.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9732/head:pull/9732
PR: https://git.openjdk.org/jdk/pull/9732
More information about the compiler-dev
mailing list