JetBrains Rider 2026.1 Help

Code inspection: Check for reference equality instead

This inspection reports System.Type.Equals instance calls that should be written as reference equality checks.

System.Type instances are compared by identity. Using == makes that intent explicit and is the preferred style for type comparisons.

Example

using System; bool AreSame(Type left, Type right) { return left.Equals(right); }
using System; bool AreSame(Type left, Type right) { return left == right; }

Quick-fix

A quick-fix helps you replace .Equals(...) with ==.

27 March 2026