8000 Preserve independent storage when copying AST expressions and types by dajiaohuang · Pull Request #1772 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Preserve independent storage when copying AST expressions and types - #1772

Open
dajiaohuang wants to merge 6 commits into
dominikh:masterfrom
dajiaohuang:fix/astutil-equal
Open

dajiaohuang wants to merge 6 commits into
dominikh:masterfrom
dajiaohuang:fix/astutil-equal

Conversation

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

CopyExpr now allocates independent storage for generic index arguments and recursively copies struct/interface fields, names, tags, comments and nested function signatures. This repairs shared AST mutations while preserving type-copy support.

Consolidates the deep-copy defect from #1793. Function literals remain unsupported.

Validation: the added field mutation regression fails against the preceding PR head; go test ./go/ast/astutil and git diff --check pass on the updated head.

@dajiaohuang dajiaohuang changed the title Correct AST equality and copy behavior Copy index-list expression slices independently Oct 2, 2026
@dajiaohuang dajiaohuang changed the title Copy index-list expression slices independently Preserve independent storage when copying AST expressions and types Oct 8, 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