The switch statement contains multiple cases with the label value
Open
- Dominant language
- C#
- Stars
- 2.4k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
Hi
i am using package 2.0.1 getting compilation error when i use two cases together.
```
switch(role.Name) {
case nameof(CommonEnums.Roles.Root.Name):
case nameof(CommonEnums.Roles.User.Name):
break;
}
```
i get error The switch statement contains multiple cases with the label value '"Name"'. Any idea whats the work around this. Thank you.
Contributor guide
Research direction
Start by reproducing the switch(role.Name) example against package 2.0.1 and inspect how the SmartEnum role names are exposed. Determine whether the duplicate nameof values come from the package or C# compilation behavior; done means documenting a verified workaround or a clearly scoped fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100