On Saturday, 4 November 2017 at 14:12:08 UTC, Adam D. Ruppe wrote:
On Saturday, 4 November 2017 at 13:59:39 UTC, Jonathan M Davis wrote:
I'm very much of the opinion that proper unit tests pretty much eliminate the need for out contracts.

I think that sqrt example is just bad. Out contracts shouldn't be testing specific values, but rather ranges or nullness or other such things that arguably should be part of the return type, but just don't fit in the type system for whatever reason.

No, Jonathan is correct. The postcondition should be able to access values as they were stated in the precondition.


Reply via email to