dotnet / dotnet/runtime

System.CodeDom.MemberAttributes enum is used as a flag but doesn't have the [Flags] attribute

Open
#127,918 3 comments 0 reactions 0 assignees View on GitHub
area-System.CodeDom
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

When defining a `CodeMember*` object, the `Attributes` can be assigned using a bitwise combination of MemberAttributes. While this works and produces the expected code output, the lack of the `[Flags]` enum causes some IDEs, like Rider, to emit a warning that the enum is being used as if it were a flag enum without having the attribute.

To resolve, the `[Flags]` attribute should be added to [`MemberAttributes.cs`](https://github.com/dotnet/runtime/blob/main/src/libraries/System.CodeDom/src/System/CodeDom/MemberAttributes.cs). No other changes are necessary,

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.