ReSharper 2026.1 Help

Code inspection: Replace object pattern not performing any additional checks with 'var' pattern

This inspection reports an object pattern with a designation that can be simplified to a var pattern. This applies when the pattern always matches and the designation is the only useful part.

Example

if (flag is { } name1) { }
if (flag is var name1) { }

Quick-fix

Replace the object pattern with a var pattern.

30 March 2026