Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes name generation for nested anonymous types #587

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Dec 14, 2024

Fixes the following issues with name generation for nested anonymous types:

  • A numeral would only be appended if the parent had more than one anonymous records, but an anonymous typed array didn't count as a record resulting in multiple structs named _Anonymous_e__Struct.
  • The code that remapped the name of anonymous types was different between the code that generated the type definition and the code that defined fields in a FixedBuffer.
  • When nesting more than one level of anonymous types, the name of the nested type could be the same as the parent type which is not permitted in C# (error CS0542: '_Anonymous_e__Struct': member names cannot be the same as their enclosing type).

@dpaoliello dpaoliello marked this pull request as ready for review December 17, 2024 18:13
@tannergooding tannergooding merged commit cbb7968 into dotnet:main Jan 10, 2025
13 checks passed
@dpaoliello dpaoliello deleted the deeplynested branch January 10, 2025 21:51
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.

2 participants