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

Do not warn when accessing fields on T constrained to be enum #100814

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

MichalStrehovsky
Copy link
Member

Fixes #97737.

Trimming ensures we keep all the public fields on enums. typeof(T).GetFields() is safe when the T is constrained to be System.Enum or a derived type.

Cc @dotnet/ilc-contrib

Fixes dotnet#97737.

Trimming ensures we keep all the public fields on enums. `typeof(T).GetFields()` is safe when the `T` is constrained to be `System.Enum` or a derived type.
Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@MichalStrehovsky MichalStrehovsky merged commit 3462976 into dotnet:main Apr 9, 2024
114 of 116 checks passed
@MichalStrehovsky MichalStrehovsky deleted the fix97737 branch April 9, 2024 21:06
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
…#100814)

Fixes dotnet#97737.

Trimming ensures we keep all the public fields on enums. `typeof(T).GetFields()` is safe when the `T` is constrained to be `System.Enum` or a derived type.
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respecting EnumMemberAttribute in AOT'd applications
3 participants