Comment by coldtea
4 days ago
>The way I reason about it is that the contracts are more soft conditions that you expect to not really reach
What's the difference from an assert then?
4 days ago
>The way I reason about it is that the contracts are more soft conditions that you expect to not really reach
What's the difference from an assert then?
The difference from an assert is that for "require" they are compiled into the caller frame, so things like stack traces (which is available in safe mode) will point exactly to where the violation happened.
Because of inlining them at the call site happens, static analysis will already pick up some obvious violations.
Finally, these contracts may be used to compile time check otherwise untyped arguments to macros.