Closed
Description
The documentation states, "Warning wave 5 diagnostics were added in C# 9." However, the given code snippet cannot be replicated for Warning wave 5, Members must be fully assigned, use of unassigned variable, in C# 9.0 as it generates errors CS8773 and CS8773 commented in the following code snippet.
NB:
Visual Studio 2022 Community Edition for Apple Silicon, MacBook Pro M1 Pro, macOS Ventura Version 13.5.2 (22G91).
Code Snippet
public struct Struct
{
// Error CS8773: Feature 'struct field initializers' is not available in C# 9.0. Please use language version 10.0 or greater.
private string data = String.Empty;
// Error CS8773: Feature 'parameterless struct constructors' is not available in C# 9.0. Please use language version 10.0 or greater.
public Struct() { }
}
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: fe4ec697-f3a5-3df8-8e43-e49df4f3303b
- Version Independent ID: ee47f321-8c41-a867-c25e-4020b7aa75eb
- Content: C# Compiler warning waves - C#
- Content Source: docs/csharp/language-reference/compiler-messages/warning-waves.md
- Service: dotnet-csharp
- Sub-service: errors-warnings
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done