8000 Preserve repeated embedded fields when flattening by dajiaohuang · Pull Request #1783 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Preserve repeated embedded fields when flattening - #1783

Open
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/flatten-fields-repeated-embeddings
Open

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/flatten-fields-repeated-embeddings

Conversation

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

FlattenFields currently keeps a global set of visited struct types. When the same embedded type appears through two separate embedding paths, the second occurrence is dropped, contradicting the API's promise to return every field and path. Restrict cycle detection to the current recursion stack and add a regression test.

Review update: the unrelated generic-instantiation change and its fixture were removed through a normal follow-up commit; #1764 tracks that fix separately. Current-head validation: go test ./go/types/typeutil (two tests) passed; git diff --check passed. Prior validation text above is historical unless repeated here.

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