This table lists the features introduced in C# versions 8 - 12 and indicates whether they are available out of the box, require additional polyfills, or require a runtime.
Feature | Out of the Box | Require polyfills | Require Runtime |
---|---|---|---|
Non-nullable references | ✔️ | ❌ | ❌ |
Switch Expressions | ✔️ | ❌ | ❌ |
Property pattern matching | ✔️ | ❌ | ❌ |
Positional pattern matching | ✔️ | ❌ | ❌ |
Static local functions | ✔️ | ❌ | ❌ |
Using declarations | ✔️ | ❌ | ❌ |
Null-coalescing assignment | ✔️ | ❌ | ❌ |
Read-only members | ✔️ | ❌ | ❌ |
Asynchronous streams | ✔️ | ❌ | ❌ |
Indices and Range | ❌ | ✔️ | ❌ |
Default interface methods | ❌ | ❌ | ✔️ |
Feature | Out of the Box | Require polyfills | Require Runtime |
---|---|---|---|
Records | ✔️ | ❌ | ❌ |
Target-typed new expressions | ✔️ | ❌ | ❌ |
Static Anonymous Functions | ✔️ | ❌ | ❌ |
Pattern matching enhancements | ✔️ | ❌ | ❌ |
Lambda discard parameters | ✔️ | ❌ | ❌ |
Target-typed conditional expressions | ✔️ | ❌ | ❌ |
Target-typed new | ✔️ | ❌ | ❌ |
ExtensionGetEnumeratorSupportForeachLoopsExample | ✔️ | ❌ | ❌ |
Native integers | ✔️ | ❌ | ❌ |
Module initializers | ✔️ | ❌ | ❌ |
Attributes on local functions | ✔️ | ❌ | ❌ |
Function pointers | ✔️ | ❌ | ❌ |
Attributes on parameters | ✔️ | ❌ | ❌ |
Positional properties | ❌ | ✔️ | ❌ |
Init-only properties | ❌ | ✔️ | ❌ |
CallerArgumentExpression | ❌ | ✔️ | ❌ |
Suppress emitting locals init | ❌ | ✔️ | ❌ |
Covariant return types | ❌ | ❌ | ✔️ |
Feature | Out of the Box | Require polyfills | Require Runtime |
---|---|---|---|
Implicit Usings | ✔️ | ❌ | ❌ |
Global using directives | ✔️ | ❌ | ❌ |
File-scoped namespaces | ✔️ | ❌ | ❌ |
Extended property patterns | ✔️ | ❌ | ❌ |
Record structs | ✔️ | ❌ | ❌ |
Improved lambda support | ✔️ | ❌ | ❌ |
Interpolated strings improvements | ✔️ | ❌ | ❌ |
Constant interpolated strings | ✔️ | ❌ | ❌ |
Mixed interpolated verbatim strings | ✔️ | ❌ | ❌ |
[Async methods improvements] | ✔️? | ❌ | ❌ |
Feature | Out of the Box | Require polyfills | Require Runtime |
---|---|---|---|
Raw string literals | ✔️ | ❌ | ❌ |
Auto default struct | ✔️ | ❌ | ❌ |
UTF 8 string literals | ✔️ | ❌ | ❌ |
File local types | ✔️ | ❌ | ❌ |
Extended nameof scope | ✔️ | ❌ | ❌ |
Generic attribute | ✔️ | ❌ | ❌ |
Pattern matching span | ✔️ | ❌ | ❌ |
Required members | ❌ | ✔️ | ❌ |
List patterns | ❌ | ✔️ | ❌ |
Static abstract members | ❌ | ❌ | ✔️ |
Feature | Out of the Box | Require polyfills | Require Runtime |
---|---|---|---|
CollectionExpressionExample | ✔️ | ❌ | ❌ |
Primary Constructors | ✔️ | ❌ | ❌ |
ref readonly parameters | ✔️ | ❌ | ❌ |
Alias for any type | ✔️ | ❌ | ❌ |
Optional Lambda expression parameters | ✔️ | ❌ | ❌ |
Inline array | ❌ | ❌ | ✔️ |