In EF Core, dotnet/efcore#21608 introduced a DiagnosticsSuppressor to suppress CS8618 (non-nullable property is uninitialized) in a specific safe scenario. In classes without a constructor, the CS8618 diagnostic is reported on the property itself, so the suppressor can look at that property and function correctly. If a constructor is defined, however, the diagnostic is reported on the constructor declaration instead of the property, and the suppressor needs some way to resolve the uninitialized property.
Diagnostic seems to have an AdditionalLocations property which looks right for this, but it's empty (because not populated for CS8618? Because it's a DiagnosticsSuppressor rather than a regular analyzer?).
Am I missing something? What would be the correct, safe way to figure out which non-nullable property is uninitialized from CS8618 in a DiagnosticsSuppressor?
Tracking issue on the EF Core side: dotnet/efcore#26879
In EF Core, dotnet/efcore#21608 introduced a DiagnosticsSuppressor to suppress CS8618 (non-nullable property is uninitialized) in a specific safe scenario. In classes without a constructor, the CS8618 diagnostic is reported on the property itself, so the suppressor can look at that property and function correctly. If a constructor is defined, however, the diagnostic is reported on the constructor declaration instead of the property, and the suppressor needs some way to resolve the uninitialized property.
Diagnostic seems to have an AdditionalLocations property which looks right for this, but it's empty (because not populated for CS8618? Because it's a DiagnosticsSuppressor rather than a regular analyzer?).
Am I missing something? What would be the correct, safe way to figure out which non-nullable property is uninitialized from CS8618 in a DiagnosticsSuppressor?
Tracking issue on the EF Core side: dotnet/efcore#26879