Code Analysis ReferenceAnalyzersRCS1166On this pageRCS1166: Value type object is never equal to nullPropertiesPropertyValueDefault SeverityInfoMinimum language version-ExamplesExample #1diagnostic.csint x = 0;IntPtr y = IntPtr.Zero// ...if (x == null){}if (y == null){}fix.csif (x == 0){}if (y == default){}Applies toExtension for VS 2022Extension for VS CodeExtension for Open VSXPackage Roslynator.Analyzers