[jdk17] RFR: 8269146: Missing unreported constraints on pattern and other case label combination [v3]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Jul 8 15:48:56 UTC 2021


On Thu, 8 Jul 2021 15:36:17 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> There is a number of constraints on the case label forms - patterns cannot be combined with patterns, etc. Currently, the checks are implemented by checking if there are clashing bindings. But this misses some of the cases which should lead to errors. This patch proposes to implement explicit checks on the structure of the case labels in `Attr.handleSwitch`, rather than relying on clashing bindings.
>
> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
> 
>  - Only run the pattern structural checks for pattern matching switches.
>  - Adding javadoc.
>  - Merging master into JDK-8269146
>  - Moving structural switch case checks from Attr to Check.
>  - Fixing fallthrough.
>  - Adding test summary.
>  - Improving code.
>  - Merging master into JDK-8269146
>  - 8269146: Missing unreported constraints on pattern and other case label combination

Looks good - I agree the code looks simpler, and there's a bit more separation of concerns

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

Marked as reviewed by mcimadamore (Reviewer).

PR: https://git.openjdk.java.net/jdk17/pull/194


More information about the compiler-dev mailing list