Skip to content

Rename a nested type named Builder to avoid a collision#3639

Merged
oldergod merged 2 commits into
square:masterfrom
eyupcanakman:fix/nested-builder-name-collision-593
Jun 29, 2026
Merged

Rename a nested type named Builder to avoid a collision#3639
oldergod merged 2 commits into
square:masterfrom
eyupcanakman:fix/nested-builder-name-collision-593

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

A message generates a nested Builder, so a proto type that is itself named Builder collided with it and the generated code did not compile. Both generators now reserve the name through a NameAllocator, renaming the nested type to Builder_. Existing output is unchanged.

Fixes #593

@oldergod

Copy link
Copy Markdown
Member

@eyupcanakman thank you! I've added a commit to be not rename anything when we don't need to.
Merging on green.

@oldergod oldergod enabled auto-merge June 29, 2026 12:10
@oldergod oldergod merged commit 8a88c76 into square:master Jun 29, 2026
10 checks passed
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.

A nested type named 'Builder' collides with our message builder.

2 participants