Skip to content

Warning wave 5: Members must be fully assigned, use of unassigned variable: Not replicable in C# 9.0 #37157

Closed
@RajaniCode

Description

@RajaniCode

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.

Metadata

Metadata

Assignees

Labels

okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions