Skip to content

Bind compound assignment operator declarations #77999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

AlekseyTs
Copy link
Contributor

No description provided.

@AlekseyTs AlekseyTs requested review from 333fred and cston April 4, 2025 01:56
@AlekseyTs AlekseyTs requested review from a team as code owners April 4, 2025 01:56
@ghost ghost added the untriaged Issues and PRs which have not yet been triaged by a lead label Apr 4, 2025
@dotnet-policy-service dotnet-policy-service bot added the Needs API Review Needs to be reviewed by the API review council label Apr 4, 2025
@cston
Copy link
Contributor

cston commented Apr 5, 2025

            ">>=" => WellKnownMemberNames.RightShiftAssignmentOperatorName,

Consider using CompoundAssignmentOperatorNameFromSyntaxKind() in all cases, to test all code paths in that method.

var kind = op switch
{
    ">>=" => SyntaxKind.GreaterThanGreaterThanEqualsToken,
    ">>>=" => SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,
    _ => SyntaxFactory.ParseToken(op).Kind(),
};
return OperatorFacts.CompoundAssignmentOperatorNameFromSyntaxKind(kind, isChecked: isChecked);
``` #Resolved

---
Refers to: src/Compilers/CSharp/Test/Emit3/Symbols/UserDefinedCompoundAssignmentOperatorsTests.cs:5979 in cba3fb7. [](commit_id = cba3fb72c94c88a493c6533271e6e8a33c6b3fa8, deletion_comment = False)

@cston
Copy link
Contributor

cston commented Apr 5, 2025

(structure ? "struct" : "class") + @" C1

Also test interface? #Resolved


Refers to: src/Compilers/CSharp/Test/Emit3/Symbols/UserDefinedCompoundAssignmentOperatorsTests.cs:6001 in cba3fb7. [](commit_id = cba3fb7, deletion_comment = False)

@AlekseyTs AlekseyTs requested a review from a team April 7, 2025 16:49
@AlekseyTs
Copy link
Contributor Author

@333fred, @dotnet/roslyn-compiler For the second review

1 similar comment
@AlekseyTs
Copy link
Contributor Author

@333fred, @dotnet/roslyn-compiler For the second review

@AlekseyTs AlekseyTs merged commit b264ee2 into dotnet:features/UserDefinedCompoundAssignment Apr 9, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature-UserDefinedCompoundAssignmentOperators Needs API Review Needs to be reviewed by the API review council untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants