ReSharper 2026.1 Help

Code inspection: Merge null/pattern/value checks into 'or'/'and' patterns

This inspection reports repeated equality checks that can be merged into a logical pattern. For example, when a sequence of || checks against the same expression the code can be rewritten as an or pattern.

Example

if (x == 42 || x == 404) { }
if (x is 42 or 404) { }

Quick-fix

Merge the repeated checks into a logical pattern.

30 March 2026