8000 Reject shallow copies of structured AST expressions by dajiaohuang · Pull Request #1820 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content
8000

Reject shallow copies of structured AST expressions - #1820

Closed
dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/astutil-copyexpr-structured-unsupported
Closed

dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/astutil-copyexpr-structured-unsupported

Conversation

@dajiaohuang
Copy link
Copy Markdown

CopyExpr promises a deep copy, but its struct and interface type cases only copied the outer AST node and returned success while sharing nested field lists and expressions with the original. Return unsupported for those types until their children can be copied recursively. All current callers check the support result and skip the suggested fix when copying is unsupported.

@dajiaohuang
Copy link
Copy Markdown
Author

Closing this duplicate after comparing the current patches. The same defect and fix are already covered by #1793. Keeping the existing contribution avoids competing review threads; the contributor branches remain preserved.

@dajiaohuang dajiaohuang closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0