Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 583 Bytes

RCS1166.md

File metadata and controls

45 lines (31 loc) · 583 Bytes

RCS1166: Value type object is never equal to null

Property Value
Id RCS1166
Category Usage
Severity Info

Example

Code with Diagnostic

int x = 0;
IntPtr y = IntPtr.Zero

// ...

if (x == null) // RCS1166
{
}

if (y == null) // RCS1166
{
}

Code with Fix

if (x == 0)
{
}

if (y == default)
{
}

See Also

(Generated with DotMarkdown)