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

Open Beginner friendly
#127,918 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
csharp
Domain
tooling

Research direction

Start with src/libraries/System.CodeDom/src/System/CodeDom/MemberAttributes.cs, which is the file named in the issue. Confirm how MemberAttributes is declared and add the requested [Flags] annotation; done when the enum is marked as a flags enum and no other changes are needed.

Written by the indexing model from the issue text.

Description

area-System.CodeDom

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. No other changes are necessary,

Dominant language
C#
Stars
18.3k
Forks
5.6k
Avg merge
2d 19h
Merged PRs (30d)
589

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.