With the following code (from
this SO question):
public static bool Foo<T>(T value, T lowerBound, T upperBound)
where T : IComparable<T>
{
Contract.Requires(upperBound.CompareTo(lowerBound) >= 0);
return IsBetween(value, lowerBound, upperBound, 1);
}
public static bool IsBetween<T>(T value, T lowerBound, T upperBound, int test) where T : IComparable<T>
{
Contract.Requires(upperBound.CompareTo(lowerBound) >= 0);
return false;
}
The call to IsBetween gets flagged with the warning "Requires unproven: upperBound.CompareTo(lowerBound) >= 0", which should be proven by the Requires in the containing method.