CS.WRONGUSE.REFEQ

The method 'Object.ReferenceEquals' is always false because it is called with a value type. Such checks are therefore not useful.

Example 1

1  namespace NameSpace {
2      struct S {
3      }
4      class A {
5      }
6  
7      class Processor {
8          public bool CompareArgs(S s, A a, Object o) {
9              if (System.Object.ReferenceEquals(s, a)) // defect
10                 return false;
11             if (System.Object.ReferenceEquals(o, s)) // defect
12                 return false;
13             if (System.Object.ReferenceEquals(a, o)) // OK
14                 return false;
15             return true;
16         }
17     }
18 }