Motivation
This exception is expected to never be thrown. Code coverage tools might choose to ignore non-coverage of the statement or branch that throws this exception. In fact, coverage of such a statement or branch is undesirable, as it would indicate that the code is making an invalid assumption.
Proposal
#nullable enable
using System.Runtime.Serialization;
namespace System
{
public sealed class UnreachableException : SystemException
{
public UnreachableException()
: base("The program executed an instruction that was thought to be unreachable.")
{
}
public UnreachableException(string? message)
: base(message)
{
}
public UnreachableException(string? message, Exception? innerException)
: base(message, innerException)
{
}
private UnreachableException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
See Also
Motivation
This exception is expected to never be thrown. Code coverage tools might choose to ignore non-coverage of the statement or branch that throws this exception. In fact, coverage of such a statement or branch is undesirable, as it would indicate that the code is making an invalid assumption.
Proposal
See Also