Skip to content
Ian Wold edited this page Nov 9, 2026 · 3 revisions

This wiki is the full reference for what UnionNarrowing does, for anyone who needs to check a specific behavior. For installation and a quick tour, see the README.

  • Diagnostics: every diagnostic ID the package reports or suppresses, and how to change their severity
  • Suppressions: exactly when CS8509, CS8846, CS8655, CS8847, IDE0072 and IDE0010 are suppressed
  • Analyzers: what each analyzer reports, and each code fix

Examples use this union, plus an IFlier interface that only Bird implements:

public record Cat(string Name);
public record Dog(string Name);
public record Bird(string Name);

public union Pet(Cat, Dog, Bird);

For worked examples, see the tests in UnionNarrowing.Tests, where every switch is marked /*suppressed*/ or /*warns*/.

Clone this wiki locally