Skip to content

Field initializer references a field which might not be initialized #42

@sharwell

Description

@sharwell

It would be nice to have an analyzer for field references which detects cases like the one described in DotNetAnalyzers/StyleCopAnalyzers#1767. This analyzer could start simple, and grow to cover additional scenarios:

  1. A field initializer references a field which is declared later in the same file
  2. A field initializer references a field declared in a different file (relative order of initialization is undefined)
  3. A cycle exists in references from field initializers to fields in other type(s)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions