8335766: Switch case with pattern matching and guard clause compiles inconsistently#20093
8335766: Switch case with pattern matching and guard clause compiles inconsistently#20093lahodaj wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
|
@lahodaj This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 9 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit 537d20a.
Your commit was automatically rebased without conflicts. |
|
/backport jdk jdk23 |
|
@lahodaj the backport was successfully created on the branch backport-lahodaj-537d20af-jdk23 in my personal fork of openjdk/jdk. To create a pull request with this backport targeting openjdk/jdk:jdk23, just click the following link: The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:
If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk: |
When javac parser see a
caselabel, it needs to disambiguate between expressions (constant labels) and patterns. But, for code like:the parser will try to parse the label as an expression, which is obviously not correct. The problem is that it does not disambiguate before
when, and there indeed is an expression afterwhen.The proposal is to disambiguate as a pattern once there is
whenafter a closing parenthesis at the top-level. This should prevent the code to even look at thewhenexpressionProgress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20093/head:pull/20093$ git checkout pull/20093Update a local copy of the PR:
$ git checkout pull/20093$ git pull https://git.openjdk.org/jdk.git pull/20093/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20093View PR using the GUI difftool:
$ git pr show -t 20093Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20093.diff
Webrev
Link to Webrev Comment