8000 Avoid returning shallow AST type copies by dajiaohuang · Pull Request #1793 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Avoid returning shallow AST type copies - #1793

Closed
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/astutil-copyexpr-shallow-types
Closed

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/astutil-copyexpr-shallow-types

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 1, 2026 •
Copy link
Copy Markdown

astutil.CopyExpr promises deep copies but returned shallow copies for struct and interface types, leaving nested field lists and expressions shared with the original. Return no copy for these unsupported expression forms until recursive copying is implemented, and document the failure contract.

Scope review and current validation

Removed the unrelated generic-instantiation change and its buildir fixture from this PR through a follow-up commit. That fix remains separately tracked in #1764; this PR now contains only its stated change and relevant tests.

go test ./go/ast/astutil passed the copy regression (1 test).
git diff --check passed. Earlier validation above is historical; the checks in this section describe the narrowed head. No live-service or all-CI-passing claim.

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