Skip to content

Review c# 10 feature: improvements of structure types #155

Open

Description

@bjornhellander

Review how the analyzers and code fixes handle parameterless struct constructors, field and property initializers in structs, and with expressions on structs and anonymous types.
See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct#struct-initialization-and-default-values

Things to check:

  • SA1129: new S() may now call a user-defined parameterless constructor, so replacing it with default(S) can change behavior.
  • SA1642: the standard summary text for a parameterless struct constructor.
  • Ordering and layout of struct members with initializers (SA1201, SA1202, SA1204).
  • with initializers on structs and anonymous types: trailing commas (SA1413), this. prefix (SA1101), spacing and layout (SA1000, SA1012, SA1013).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions