Code inspection: Redundant property pattern clause
This inspection reports an empty property pattern clause { } when it does not add any checks beyond the surrounding pattern. In that case, the empty clause is redundant and only makes the pattern harder to read.
public struct Foo
{
public void Deconstruct(out int value) => value = 42;
public bool M(Foo? foo) => foo is Foo(42) { };
}
public struct Foo
{
public void Deconstruct(out int value) => value = 42;
public bool M(Foo? foo) => foo is Foo(42);
}
13 April 2026