-
Notifications
You must be signed in to change notification settings - Fork 634
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 for regression in Node2Code. #11373
Conversation
@aparajit-pratap thanks for fixing this so quickly, |
@@ -106,7 +106,7 @@ public override AssociativeNode VisitIdentifierNode(IdentifierNode node) | |||
// return IdentifierNode if identifier string is not separated by '.' | |||
if (strIdentList.Length == 1) | |||
{ | |||
return new IdentifierNode(strIdentList[0]); | |||
return node; |
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.
If my memory serves correctly, then the AST walkers are a bit inconsistent when it comes to returning new AST nodes or the same node - maybe this should return a copy of the node instead?
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.
The AST walkers are meant to return new nodes only if they are rewritten and return the original node if there is no change.
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.
ah! Is that documented somewhere? Would it make sense to add a note about that to the base class or something? Not that it needs to be part of this pr.
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.
Can do.
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.
Looks good to me. Thanks for fixing @aparajit-pratap !
Purpose
Fix for regression in Node2Code.
Declarations
Check these if you believe they are true
*.resx
filesFYIs
@saintentropy