I may be missing something, or I may be asking CC for something I shouldn't be, but -
Is there a way to specify that a parameter "may or may not be null" without coming off as entirely redundant?
For instance, imagine this contrived example:
string F(string x)
{
Contract.Requires(x == null || x != null);
return x ?? "Hello world!";
}
With the above, the ccchecker kindly lets me know of the redundancy:
CodeContracts: Suggested requires: This precondition is redundant: Consider removing it.
Update: Matt Burland summed up the intent, if that changes responses any,
[What the] OP wants to be able to do is make a note that they didn't forget about adding a requirement ..