-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used:
.NET SDK 7.0.102
Steps to Reproduce:
dotnet build the following:
Program.cs
static string TestSwitch(int foo)
=> foo switch
{
0 => "zero",
< 0 => "negative",
> 0 => "positive",
};ConsoleApp0.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</Project>.editorconfig
[*.cs]
dotnet_diagnostic.IDE0072.severity = warningDiagnostic Id: IDE0072
Expected Behavior:
IDE0072 is not raised: all cases are handled
Actual Behavior:
IDE0072 is raised. The suggested fix is to add a default arm. When I do that, I get a message that (correctly) informs me that The pattern has already been handled by a previous arm of the 'switch' expression
JakeYallop
Metadata
Metadata
Assignees
Labels
Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed