diff --git a/docs/cpp2/contracts.md b/docs/cpp2/contracts.md index 61183ef60..b197073ad 100644 --- a/docs/cpp2/contracts.md +++ b/docs/cpp2/contracts.md @@ -5,7 +5,7 @@ Cpp2 currently supports three kinds of contracts: -- **Preconditions and postconditions.** A function declaration can include `pre(condition)` and `post(condition)` before the `= /* function body */`. Before entering the function body, preconditions are fully evaluated and postconditions are captured (and performs their captures, if any). Immediately before exiting the function body via a normal return, postconditions are evaluated. If the function exits via an exception, postconditions are not evaluated. +- **Preconditions and postconditions.** A function declaration can include `pre(condition)` and `post(condition)` before the `= /* function body */`. Before entering the function body, preconditions are fully evaluated and postconditions are captured as function expressions to be evaluated later (and perform their captures of values on entry, if any). Immediately before exiting the function body via a normal return, postconditions are evaluated. If the function exits via an exception, postconditions are not evaluated. - **Assertions.** A function body can write `assert(condition)` assertion statements. Assertions are evaluated when control flow passes through them.