Still learning code contracts. When I create a small test, I get the following message from the checker: CodeContracts: Invoking this method will always lead to an error. If this is wanted, consider adding Contract.Requires(false) to document it.
I don't understand what it is try to tell me. How would I add Contract.Requires(false) to this example so the warning is not shown?
This is the code. Note that this is a contrived example solely for the purpose of learning CC.
void DoSomething(object test) {
Contract.Requires(test != null);
MessageBox.Show(test.ToString());
}
void InvokeDoSomething() {
DoSomething(null);
}