8304883: Record Deconstruction causes bytecode error#13192
8304883: Record Deconstruction causes bytecode error#13192lahodaj wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
| JCExpression guard = translate(label.guard); | ||
| if (hasJoinedNull) { | ||
| JCPattern pattern = label.pat; | ||
| while (pattern instanceof JCParenthesizedPattern parenthesized) { |
There was a problem hiding this comment.
side: this idiom seems to be useful, currently used in a couple of places in Check, could it make sense to extract it into a method?
|
@lahodaj this pull request can not be integrated into git checkout JDK-8304883
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@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 88 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
Going to push as commit 2aec910.
Your commit was automatically rebased without conflicts. |
Originally, we used to support cases like:
case null, String s when s.isEmpty() -> <expression>where
scould benullinside the expression, but the guard was only evaluated whens != null. This was implemented by augmenting the guard withs == null || <original-guard>.This feature has been dropped since then.
Also note that in other cases, like:
We always expected a NPE on dereferencing the binding with value
null(vin this case) in guard.But, the code to implement the
case null, <binding>remained in javac, and is causing problems, because, while the user cannot writecase null, <binding>anymore, internally the desugaring sometimes generates that (when factoring out common prefixes). And the original code will still augment the guards to<binding> == null || <guard>, which causes the variables that are assigned in the guard to not being definitely assigned after the augmented guard.The proposal is to simply remove the code that adds
<binding> == null || <guard>, as there's no case where we would skip guards fornullbindings anymore.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13192/head:pull/13192$ git checkout pull/13192Update a local copy of the PR:
$ git checkout pull/13192$ git pull https://git.openjdk.org/jdk.git pull/13192/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13192View PR using the GUI difftool:
$ git pr show -t 13192Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13192.diff
Webrev
Link to Webrev Comment