|
2 | 2 |
|
3 | 3 | .NET 10 Preview 1 includes the following C# features & enhancements: |
4 | 4 |
|
5 | | -- [Feature](#feature) |
| 5 | +- [`nameof` in unbound generics](#unbound-generic-support-for-nameof) |
| 6 | +- [Implicit span conversions](#implicit-span-conversions) |
| 7 | +- [`field` backed properties](#field-backed-properties) |
| 8 | +- [Modifiers on simple lambda parameters](#modifiers-on-simple-lambda-parameters) |
| 9 | +- [Experimental feature - String literals in data section](#preview-feature-string-literals-in-data-section) |
| 10 | + |
6 | 11 |
|
7 | 12 | C# 14 updates: |
8 | 13 |
|
9 | 14 | - [What's new in C# 14](https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-14) documentation |
10 | 15 | - [Breaking changes in C# 14](https://learn.microsoft.com/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010) |
11 | 16 |
|
12 | | -## Feature |
| 17 | +## Field-backed properties |
| 18 | + |
| 19 | +Field-backed properties provide a smoother path from auto-implemented properties to writing your own `get` and `set` accessors. You can access the compiler-generated backing field using the `field` contextual keyword in a `get` or `set` accessor. You can learn more about this feature in the article on the new [`field` keyword](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/field). |
| 20 | + |
| 21 | +## Unbound generic support for `nameof` |
| 22 | + |
| 23 | +The argument to a `nameof` expression can be an unbound generic type, like `List<>`. The result of the expression is "List". Previously, you'd need to supply a type argument for each type parameter. You can learn more in our docs on the [`nameof`](https://learn.microsoft.com/dotnet/csharp/language-reference/operators/nameof) expression. |
| 24 | + |
| 25 | +## Implicit Span conversions |
| 26 | + |
| 27 | +C# 14 introduces first-class support for `Span<T>` and `ReadOnlySpan<T>` in the language. `Span<T>` and `ReadOnlySpan<T>` are used in many key ways in C# and the runtime. This support involves new implicit conversions allowing more natural programming with these types. |
| 28 | + |
| 29 | +You can learn more in the article on [built-in types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/built-in-types.md) in the C# guide. |
| 30 | + |
| 31 | +## Modifiers on simple lambda parameters |
| 32 | + |
| 33 | +You can add parameter modifiers, such as `ref`, `in`, or `out` to lambda expressions without specifying the type of the parameters. This makes it easier for you to use these modifiers. You can learn more in the article on [lambda expressions](https://learn.microsoft.com/dotnet/csharp/language-reference/operators/lambda-expressions.md#input-parameters-of-a-lambda-expression) in the C# language reference. |
| 34 | + |
| 35 | +## Experimental feature: String literals in data section |
| 36 | + |
| 37 | + |
| 38 | +This opt-in experimental feature allows changing how string literals in C# programs are emitted into PE files. By turning on the feature flag, string literals (where possible) are emitted as UTF-8 data into a different section of the PE file without a data limit. The emit format is similar to explicit UTF-8 string literals. |
| 39 | + |
13 | 40 |
|
14 | | -This is something about the feature |
| 41 | +You can learn more by reading the feature [documentation](https://github.com/dotnet/roslyn/blob/main/docs/features/string-literals-data-section.md). |
0 commit comments