- Compiler and language feature status
- Log of breaking changes
- NuGet packages
- C# language version history
The C# compiler now supports the 7.3 set of language features including:
System.Enum
,System.Delegate
andunmanaged
constraints.- Ref local re-assignment: Ref locals and ref parameters can now be reassigned with the ref assignment operator (
= ref
). - Stackalloc initializers: Stack-allocated arrays can now be initialized, e.g.
Span<int> x = stackalloc[] { 1, 2, 3 };
. - Indexing movable fixed buffers: Fixed buffers can be indexed into without first being pinned.
- Custom
fixed
statement: Types that implement a suitableGetPinnableReference
can be used in afixed
statement. - Improved overload candidates: Some overload resolution candidates can be ruled out early, thus reducing ambiguities.
- Expression variables in initializers and queries: Expression variables like
out var
and pattern variables are allowed in field initializers, constructor initializers and LINQ queries. - Tuple comparison: Tuples can now be compared with
==
and!=
. - Attributes on backing fields: Allows
[field: …]
attributes on an auto-implemented property to target its backing field.
The C# compiler now supports:
- Compiler server on CoreCLR, for build throughput performance
- Strong name signing on CoreCLR (
/keyfile
option, all OSes)
Two minor languages changes where made to the 7.2 language features:
- Tie-breaker for
in
overloads (details) - Relax ordering of
ref
andthis
in ref extension methods (details)
The C# compiler now supports the 7.2 set of language features including:
- Support for the
Span<T>
type being used throughout Kestrel and CoreFX via theref struct
modifier. readonly struct
modifier: Enforces that all members of a struct arereadonly
. This adds a layer of correctness to code and also allows the compiler to avoid unnecessary copying of values when accessing members.in
parameters /ref readonly
returns: Allows for unmodifiable structs to be safely passed and returned with the same efficiency as modifiableref
values.private protected
access modifier: Restricts access to the intersection ofprotected
andinternal
.- Non-trailing named arguments: Named arguments can now be used in the middle of an argument list without the requirement that all following arguments are passed by name as well.
The C# compiler now supports the 7.1 set of language features, including:
The C# and VB compilers now can produce reference assemblies.
When you use C# 7.1 features in your project, lightbulb offers to upgrade your project’s language version, to “C# 7.1” or “latest”.
The C# compiler now supports the 7.0 set of language features, including:
- Out variables
- Pattern matching
- Tuples
- Deconstruction
- Discards
- Local Functions
- Binary Literals
- Digit Separators
- Ref returns and locals
- Generalized async return types
- More expression-bodied members
- Throw expressions