Skip to content

Commit 8d41e77

Browse files
BillWagnermartincostellojamesmontemagnoKathleenDollard
authored
C# and VB release notes for Preview 1 (#9739)
* First draft of C# and VB release notes * Apply suggestions from code review Co-authored-by: Martin Costello <martin@martincostello.com> * Update release-notes/10.0/preview/preview1/visualbasic.md Co-authored-by: Kathleen Dollard <kathleen.dollard@microsoft.com> * Add additional features My first draft had missed a few features. * Apply suggestions from code review Co-authored-by: Kathleen Dollard <kathleen.dollard@microsoft.com> * Update release-notes/10.0/preview/preview1/csharp.md --------- Co-authored-by: Martin Costello <martin@martincostello.com> Co-authored-by: James Montemagno <james.montemagno@gmail.com> Co-authored-by: Kathleen Dollard <kathleen.dollard@microsoft.com>
1 parent 5d25d28 commit 8d41e77

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

release-notes/10.0/preview/preview1/csharp.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,40 @@
22

33
.NET 10 Preview 1 includes the following C# features & enhancements:
44

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+
611

712
C# 14 updates:
813

914
- [What's new in C# 14](https://learn.microsoft.com/dotnet/csharp/whats-new/csharp-14) documentation
1015
- [Breaking changes in C# 14](https://learn.microsoft.com/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010)
1116

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+
1340

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).

release-notes/10.0/preview/preview1/visualbasic.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@
55
- [`unmanaged` constraint support](#unmanaged-constraint-support)
66
- [Honor overload resolution priority](#honor-overload-resolution-priority)
77

8+
These features are part of our strategy to ensure that Visual Basic can consume updated features in C# and the runtime. These features won't change how you write Visual Basic code, you'll just find it easier to use the latest runtime APIs.
9+
10+
811
Visual Basic updates:
912

1013
- [What's new in Visual Basic](https://learn.microsoft.com/dotnet/visual-basic/whats-new/) documentation
1114
- [Breaking changes](https://learn.microsoft.com/dotnet/visual-basic/whats-new/breaking-changes)
1215

1316
## `unmanaged` constraint support
1417

15-
This is something about the feature/change and a link to the documetnation
18+
C# added the `unmanaged` generic constraint. The Visual Basic compiler now interprets that constraint and enforces it. Previously, the Visual Basic compiler issues an error if you access a type parameter with the `unmanaged` constraint. You can learn more in the article on [generic types](https://learn.microsoft.com//dotnet/visual-basic/programming-guide/language-features/data-types/generic-types#types-of-constraints) in the Visual Basic documentation.
1619

1720
## Honor overload resolution priority
1821

19-
This is something about the feature/change and a link to the documetnation
22+
The Visual Basic compiler now respects the [`OverloadResolutionPriorityAttribute`](https://learn.microsoft.com/dotnet/api/system.runtime.compilerservices.overloadresolutionpriorityattribute) used to resolve ambiguities among method overloads. This feature means that new, faster Span-based overloads are preferred by the VB compiler. Without this, VB would either get a slower overload, or have an ambiguity. You can learn how it works in the article on [overload resolution](https://learn.microsoft.com/dotnet/visual-basic/programming-guide/language-features/procedures/overload-resolution)

0 commit comments

Comments
 (0)