Update CSharpSyntaxGenerator for records#48096
Conversation
|
You might want to consider merging in #48099 |
@CyrusNajmabadi Did you mean using switch expression here and close #48099? I see the other PR now have auto-merge label |
src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs
Outdated
Show resolved
Hide resolved
I think this is a straight up issue the compiler should warn about itself. i.e. the branch is unreachable and the compiler can determine that. Because it's legal code today, it should come in a warning wave. Tagging @gafter . For context Neal, the code looked like this: case TypeDeclarationSyntax typeDeclaration:
return this.AsClassMember(member, typeDeclaration.Identifier.Text);
case InterfaceDeclarationSyntax:The second case is never reachable as the preceding case will always match if it would match. Can we warning wave this? |
I edited the original comment. It is covered by CS8120 that wasnt showing locally for some reason. |
|
@CyrusNajmabadi Is there anything left for this? |
|
Thanks! |
Not sure how/where to test these changes.