You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The switch expression covers all possible cases, yet the analyzer requests a default case, which would be unreachable.
Steps To Reproduce
privateboolisRed=true;privateboolisRound=false;privatestringresult=>(isRed,isRound) switch
{(true,true)=>"Red and round",(true,false)=>"Red but not round",(false,true)=>"Not red but round",(false,false)=>"Not red and not round",};
The text was updated successfully, but these errors were encountered:
Although from a cursory look, I don't think this is particularly trivial issue to fix as the issue is because switches are currently only analyzed in a more detailed manner for Booleans and Enums. Tuples can contain other tuples and each tuple may contain up to 8 types.
Analyzer
Diagnostic ID: IDE0072:
Add missing cases to switch expression
Analyzer source
SDK: Built-in CA analyzers in .NET 5 SDK or later
Version: SDK 8.0.303
Describe the bug
The switch expression covers all possible cases, yet the analyzer requests a default case, which would be unreachable.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: