ReSharper 2026.1 Help

Code inspection: Merge 'and' pattern

This inspection reports an and pattern whose operands can be merged into a simpler single pattern. In the tested cases, this happens when one side of the and already narrows the type and the other side adds a compatible pattern condition.

Example

if (o is A and ("", 0)) { }
if (o is A("", 0)) { }

Quick-fix

Merge the compatible parts of the and pattern into one pattern.

30 March 2026