I got the following code:
protected virtual string FormatException(Exception exception, int intendation)
{
Contract.Requires(intendation >= 0);
Contract.Requires<ArgumentNullException>(exception != null);
Contract.Ensures(!String.IsNullOrEmpty(Contract.Result<string>()));
var msg = exception.ToString().Replace("\r\n", "\r\n".PadRight(intendation, '\t'));
string text = string.Format("\r\n******* EXCEPTION ********\r\n\t{0}", msg);
return text;
}
It gives me
Warning 19 CodeContracts: ensures unproven: !String.IsNullOrEmpty(Contract.Result())
Why?