ReSharper 2026.1 Help

Code inspection: The source expression never matches the provided pattern

This inspection reports pattern matching code where the pattern can never match the tested value. That means the condition is effectively always false, and the code inside that branch will never run.

Example

void M(int number) { if (number is string text) { } }
void M(int number) { if (false) { } }

Quick-fix

Remove the unreachable code or correct the pattern.

01 April 2026