JetBrains Rider 2026.3 Help

Code inspection: Unused union case (non-private accessibility)

This inspection reports a case of a union type with non-private accessibility that is never used in the solution, that is, the case is never used to create an instance of the union type. Remove the unused case, or create an instance of it where you need it.

This inspection requires solution-wide analysis.

Example

public union Result(int, string); class Program { void Run() { Result result = 1; } }
public union Result(int); class Program { void Run() { Result result = 1; } }
27 October 2026