Conversation
Move the features currently in Preview to the new C# 11 page.
In this commit, add troubleshooting information on compiler breaking changes.
Co-authored-by: David Pine <david.pine@microsoft.com>
docs/csharp/whats-new/csharp-11.md
Outdated
| Beginning with the .NET 6.0.200 SDK or Visual Studio 2022 version 17.1, preview features in C# are available for you to try. | ||
|
|
||
| > [!IMPORTANT] | ||
| > These are currently preview features. You must [set `<LangVersion>` to `Preview`](../language-reference/compiler-options/language.md#langversion) to enable these features. Any feature may change before its final release. These features may not all be released in C# 11. Some may remain in a preview phase for longer based on feedback on the feature. |
There was a problem hiding this comment.
nit: We typically use lower-cased "preview" for <LangVersion>
There was a problem hiding this comment.
"These are currently preview features. You must ..." is duplicated. Looks like a copy&paste mistake.
jcouv
left a comment
There was a problem hiding this comment.
LGTM Thanks (iteration 4) modulo typos
Co-authored-by: Charles Stoner <10732005+cston@users.noreply.github.com>
…er/docs into better-breaking-changes
KathleenDollard
left a comment
There was a problem hiding this comment.
This is awesome. I would like to see error numbers in the breaking changes where an error may occur, and perhaps exact text. Maybe not in the header if you think this is not the most important way people will encounter an error.
|
|
||
| To address the issue, in .NET SDK 6.0.200 (VS 17.1) the compiler no longer synthesizes a parameterless constructor. If a `struct` contains field initializers and no explicit constructors, the compiler generates an error. If a `struct` has field initializers it must declare a constructor, because otherwise the field initializers are never executed. | ||
|
|
||
| Additionally, all fields must be definitely assigned in `struct` constructors that do not have a `: this()` initializer, so any previously unassigned fields must be assigned from the constructor or from field initializers. |
There was a problem hiding this comment.
What is a "previously unassigned field" here? (IOW, what other than initializers and constructors might initialize them?)
There was a problem hiding this comment.
"Previously unassigned" was meant as "not assigned in code compiled with 17.0". I've added a suggested change below to try to clarify.
Co-authored-by: Charles Stoner <10732005+cston@users.noreply.github.com>
Fixes #28442
Fixes #28446
Two sets of changes to improve adoption of new features.
First move features currently in preview from the C# 10 what's new page to the C# 11 what's new page.
Second, add details on the latest (and upcoming) breaking changes in the compiler
Internal Preview links:
Breaking changes
C# 10
C# 11