Skip to content

Update CSharpSyntaxGenerator for records#48096

Merged
CyrusNajmabadi merged 6 commits intodotnet:masterfrom
Youssef1313:patch-28
Oct 4, 2020
Merged

Update CSharpSyntaxGenerator for records#48096
CyrusNajmabadi merged 6 commits intodotnet:masterfrom
Youssef1313:patch-28

Conversation

@Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Sep 27, 2020

Not sure how/where to test these changes.

@Youssef1313 Youssef1313 requested a review from a team as a code owner September 27, 2020 21:25
@CyrusNajmabadi
Copy link
Contributor

You might want to consider merging in #48099

@Youssef1313
Copy link
Member Author

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

@jinujoseph jinujoseph added Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Sep 28, 2020
@CyrusNajmabadi
Copy link
Contributor

@Evangelink @mavasani Is this something suitable to be handled by CAxxxx or IDExxxx?

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?

@Youssef1313
Copy link
Member Author

@Evangelink @mavasani Is this something suitable to be handled by CAxxxx or IDExxxx?

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.

@Youssef1313
Copy link
Member Author

@CyrusNajmabadi Is there anything left for this?

@CyrusNajmabadi
Copy link
Contributor

Thanks!

@CyrusNajmabadi CyrusNajmabadi merged commit 4239a7a into dotnet:master Oct 4, 2020
@ghost ghost added this to the Next milestone Oct 4, 2020
@Youssef1313 Youssef1313 deleted the patch-28 branch October 4, 2020 21:25
@Cosifne Cosifne modified the milestones: Next, 16.9.P1 Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants