-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support Records in GenAPI #34433
Support Records in GenAPI #34433
Conversation
Class records are mostly handled and regenerated with minimal compiler boilerplate. �Struct records show all the compiler generated boilerplate as I don't try to discern them from regular structs. We could do more here - by recognizing all the compiler generated members and reducing, but it's not necessary for compat parity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just have questions.
src/Tests/Microsoft.DotNet.GenAPI.Tests/CSharpFileBuilderTests.cs
Outdated
Show resolved
Hide resolved
src/ApiCompat/Microsoft.DotNet.ApiCompatibility/Microsoft.DotNet.ApiCompatibility.csproj
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is slightly more costly now, I think it fits better into the existing filtering story. If we would like to mitigate the cost of recurring calls to symbol.ContainingType.TryGetRecordConstructor
, we could add caching to the filter.
Looks like I broke things a bit when moving to the filter. Fixing ... |
If we wanted to better handle struct records we could implement our own heuristic for detecting them from metadata - essentially if we see the entire set of methods that could be replaced with |
Fixes #32196
Class records are mostly handled and regenerated with minimal compiler boilerplate.
Struct records show all the compiler generated boilerplate as I don't try to discern them from regular structs. We could do more here - by recognizing all the compiler generated members and reducing, but it's not necessary for compat parity.