Code inspection: Pattern is always 'true' or always 'false'
This inspection reports a pattern that always matches or never matches according to control-flow and value analysis. That usually means the pattern is redundant, unreachable, or does not express the intended condition.
Example
class C
{
void M(bool value)
{
_ = value is true;
}
}
class C
{
void M(bool value)
{
_ = value;
}
}
Quick-fix
When the pattern is always false instead, the fix depends on context. In some cases the best correction is to rewrite the condition rather than simplify the pattern.
13 April 2026