8000 Handle aliases to unnamed struct types by dajiaohuang · Pull Request #1786 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Handle aliases to unnamed struct types - #1786

Open
dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/structlayout-alias-type
Open

dajiaohuang wants to merge 3 commits into
dominikh:masterfrom
dajiaohuang:fix/structlayout-alias-type

Conversation

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

structlayout accepts any package-scope type whose underlying type is a struct, but its display prefix assumes every unaliased type is a *types.Named. An alias to an anonymous struct satisfies the command's check and then panics at that assertion. Preserve the requested alias name as a fallback 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 ./cmd/structlayout (one test) 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

Uh oh!

There was an error while loading. Please reload this page.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0