-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8304883: Record Deconstruction causes bytecode error #13192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back jlahoda! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -534,19 +534,6 @@ private void handleSwitch(JCTree tree, | |||
JCExpression test = (JCExpression) this.<JCTree>translate(label.pat); | |||
if (label.guard != null) { | |||
JCExpression guard = translate(label.guard); | |||
if (hasJoinedNull) { | |||
JCPattern pattern = label.pat; | |||
while (pattern instanceof JCParenthesizedPattern parenthesized) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
s
could benull
inside 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
(v
in 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 fornull
bindings anymore.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13192/head:pull/13192
$ git checkout pull/13192
Update a local copy of the PR:
$ git checkout pull/13192
$ git pull https://git.openjdk.org/jdk.git pull/13192/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13192
View PR using the GUI difftool:
$ git pr show -t 13192
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13192.diff
Webrev
Link to Webrev Comment