-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Language Feature Roadmap
Siegfried Pammer edited this page Dec 4, 2021
·
6 revisions
Current language feature status of the master branch is detailed in #829. The following list shows all completed language versions.
- XmlDoc (see also #163)
- switch(string) (see
Switch
tag as well) - goto case -> #316
- params
- unsafe -> #924
C# 2 (VS 2005)
- Generics
-
Partial types: These are not applicable in decompiled code, as the code is decompiled into exactly one part. - Anonymous methods
- Iterators
- Nullable types ->
Nullable<T>
- Getter/setter separate accessibility
- Method group conversions (delegates)
- Co- and Contra-variance for delegates and interfaces
- Static classes
- Delegate inference
C# 3 (VS 2008)
- Implicitly typed local variables
- Object and collection initializers
- Auto-Implemented properties
- Anonymous types
- Extension methods
- Query expressions
- Lambda expression
- Expression trees
-
Partial methods: These are not applicable in decompiled code, as the code is decompiled into exactly one part.
C# 4 (VS 2010)
- Dynamic binding -> #154
- Named arguments -> #950
- Optional arguments -> #1083
- Generic co- and contravariance
-
Embedded interop types ("NoPIA"): TODO
C# 5 (VS 2012)
- Asynchronous methods
-
Caller info attributes: In general it's not possible to remove the compiler-generated values, because that would require us to produce the exact original source code, which is impossible.
C# 6 (VS 2015)
- Compiler-as-a-service (Roslyn)
-
Import of static type members into namespace: Currently, there are no plans to emitusing static
declarations. - Exception filters (see #761)
- Await in catch/finally blocks
- Auto property initializers
- Default values for getter-only properties
- Expression-bodied members
- Null propagator (null-conditional operator, succinct null checking)
- String interpolation (see #1012)
-
nameof operator - Dictionary initializer
- Allow 'Add' extension methods in collection initializers
C# 7.0 (Visual Studio 2017)
- Out variables
- Pattern matching --> #2048
- Tuples --> #1134
- Deconstruction --> #1832
- Discards
- Local Functions
-
Binary Literals -
Digit Separators - Ref returns and locals
- Generalized async return types
-
More expression-bodied members - Throw expressions
C# 7.1 (Visual Studio 2017 version 15.3)
- Async main --> #1023
- Default expressions
- Reference assemblies
-
Inferred tuple element names - Pattern-matching with generics
C# 7.2 (Visual Studio 2017 version 15.4)
- ref readonly
- interior pointer/Span/ref struct
- non-trailing named arguments
- private protected (see #1010)
- conditional ref operator
-
Digit separator after base specifier
C# 7.3 (Visual Studio 2017 version 15.7)
-
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, for example
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!=
. -> #1822 - Attributes on backing fields: Allows
[field: …]
attributes on an auto-implemented property to target its backing field.
C# 8.0 (Visual Studio 2019)
- Default Interface Methods
- Async streams
-
await foreach
- Nullable reference type
- Readonly members
- Recursive patterns
- Switch expressions
- Enhanced using (
using var ... = ...;
) -
await using
- Disposable ref struct
- Ranges
- Null-coalescing Assignment
-
Alternative interpolated verbatim strings - stackalloc in nested contexts
- Unmanaged generic structs
- Static local functions
C# 9 (VS 2019 16.8)
-
Target-typed new - Skip locals init
- Lambda discard parameters
- Native ints
- Attributes on local functions
- Function pointers
- Pattern matching improvements
-
Static lambdas - Records -> #2217
- Target-typed conditional
- Covariant Returns --> #2470
- Extension GetEnumerator
- Module initializers
-
Extending Partial -
Top-level statements
C# 10 (VS 2022 17.0)
- Record structs
-
Global Using Directive - Improved Definite Assignment
-
Constant Interpolated Strings - Extended property patterns
- Sealed record ToString
-
Source Generator V2 APIs - Mix declarations and variables in deconstruction
- Async method builder override
-
Enhanced#line
directive - Lambda improvements
- Static Abstract Members In Interfaces C# 10 Preview
- Interpolated string improvements
- File-scoped namespace
- Parameterless struct constructors
-
Caller expression attribute