Code inspection: Check for reference equality instead
This inspection reports static Equals(type1, type2) calls used to compare System.Type values.
System.Type comparison is a reference comparison. Using == is shorter and better communicates that two type objects are expected to be the same runtime type instance.
Example
using System;
bool AreSame(Type left, Type right)
{
return Equals(left, right);
}
using System;
bool AreSame(Type left, Type right)
{
return left == right;
}
Quick-fix
A quick-fix helps you replace Equals(left, right) with left == right.
27 March 2026