What's new in C# 13
C# 13 includes the following new features. You can try these features using the latest Visual Studio 2022 version or the .NET 9 SDK:
paramscollections- New
locktype and semantics. - New escape sequence -
\e. - Method group natural type improvements
- Implicit indexer access in object initializers
- Enable
reflocals andunsafecontexts in iterators and async methods - Enable
ref structtypes to implement interfaces. - Allow ref struct types as arguments for type parameters in generics.
- Partial properties and indexers are now allowed in
partialtypes. - Overload resolution priority allows library authors to designate one overload as better than others.
Beginning with Visual Studio 17.12, C# 13 includes the field contextual keyword as a preview feature.
C# 13 is supported on .NET 9. For more information, see C# language versioning.
You can download the latest .NET 9 SDK from the .NET downloads page. You can also download Visual Studio 2022, which includes the .NET 9 SDK.
You can find any breaking changes introduced in C# 13 in our article on breaking changes.
No comments:
Post a Comment