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:
- A field initializer references a field which is declared later in the same file
- A field initializer references a field declared in a different file (relative order of initialization is undefined)
- A cycle exists in references from field initializers to fields in other type(s)