-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix Issue 3281 by merging stores after expression statements #151
Conversation
public List<ReturnNode> getReturnNodes() { | ||
return returnNodes; | ||
} | ||
|
||
/** | ||
* Return the top-level nodes of all the expression statements encountered. |
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.
To be consistent, here maybe also use Returns
?
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.
Okay, thanks for pointing out!
@@ -3616,7 +3669,11 @@ public Node visitErroneous(ErroneousTree tree, Void p) { | |||
|
|||
@Override | |||
public Node visitExpressionStatement(ExpressionStatementTree tree, Void p) { | |||
return scan(tree.getExpression(), p); | |||
Node node = scan(tree.getExpression(), p); |
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.
Thanks for exploring this option.
Can you investigate the following alternative: Here, create a local variable and assign non-void expressions to that local variable.
I think that should also cause merging of the two branches and is far less invasive than adding expressionStatementRootNodes
, for which I don't really see a good use case.
This PR tries to solve typetools#3281. However, the solution touches the dataflow framework infrastructure by handling special cases in method |
Co-authored-by: Suzanne Millstein <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Ernst <[email protected]> Co-authored-by: Manu Sridharan <[email protected]>
This PR fixes typetools#3281 by merging stores after expression statements, as follows.