Skip to content

[C# 14-Fundamentals and reference]: New Feature - User defined compound assignment operators #46100

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

Open
BillWagner opened this issue May 13, 2025 · 0 comments
Assignees
Labels
🏁 Release: .NET 10 Work items for the .NET 10 release dotnet-csharp/svc 📌 seQUESTered Identifies that an issue has been imported into Quest. whats-new/subsvc

Comments

@BillWagner
Copy link
Member

BillWagner commented May 13, 2025

Visual Studio release

other - specify below

Link to speclet

Link to Pull request

New behavior

Type authors can now define the behavior for compound assignment operators, such as += or *=.

Prior to this, authors could override +, and *, bur not =. The compound assignment operators have been defined to call the binary arithmetic operators and then the assignment operator.

This will allow authors to provide a "modify in place" implementation.

Language reference tasks

  • This removes a restriction on these operators.
  • It expands the list of overridable operators.
  • Check all docs for where the (now invalid) restriction has been mentioned.

Everyday C# tasks

No response


Associated WorkItem - 431829

@BillWagner BillWagner self-assigned this May 13, 2025
@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label May 13, 2025
@BillWagner BillWagner added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label May 14, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label May 14, 2025
@dotnet-policy-service dotnet-policy-service bot removed ⌚ Not Triaged Not triaged 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. labels May 14, 2025
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏁 Release: .NET 10 Work items for the .NET 10 release dotnet-csharp/svc 📌 seQUESTered Identifies that an issue has been imported into Quest. whats-new/subsvc
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant