class Program
{
static void Main()
{
Equals(null, null);
}
}
Try context action 'Use equality operator'.
class Program
{
static void Main()
{
null == null; // error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
}
}
Context action 'Use equality operator' shall be disabled for such cases.
Possibly, it makes sense to show warning if return value of methods, inherited from System.Object (Equals, ToString etc), is ignored.
Description
class Program
{
static void Main()
{
Equals(null, null);
}
}
Try context action 'Use equality operator'.
class Program
{
static void Main()
{
null == null; // error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
}
}
Context action 'Use equality operator' shall be disabled for such cases.
Possibly, it makes sense to show warning if return value of methods, inherited from System.Object (Equals, ToString etc), is ignored.