IDE0072: False positive when using switch expression over a Nullable<T>, where both null and T cases are present #50983
Labels
Area-IDE
Bug
Feature - IDE0072
Populate switch expression
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
IDE-CodeStyle
Built-in analyzers, fixes, and refactorings
Milestone
Version Used:
.NET SDK 5.0.102
Steps to Reproduce:
dotnet build
the following:Program.cs
ConsoleApp0.csproj
.editorconfig
Expected Behavior:
IDE0072 is not raised: all cases are handled
Actual Behavior:
IDE0072 is raised. The suggested fix is to add a default case (discard) at the end.
Based on #50982 (comment), I suspect that this may have the same root cause as both that issue and #48876, but I'm logging it separately for now just in case it does happen to be different enough.
The text was updated successfully, but these errors were encountered: