Skip to content

Commit 45d78f5

Browse files
authored
Postconditions don't include the details of reported errors
1 parent d9dc9e4 commit 45d78f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

better-code/src/chapter-2-contracts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,10 @@ function's author—the function's **contract**:
270270
- The precondition describes which calls to a function should be
271271
considered valid.
272272
- The postcondition specifies only the function's _intended_ behaviors
273-
_when correctly invoked_. Details such as the precise order of equivalent
274-
elements after an unstable sort, or what happens when preconditions
275-
are violated, are omitted.
273+
_when correctly invoked_ and _successful_. Details such as the precise
274+
order of equivalent elements after an unstable sort, what happens when
275+
preconditions are violated, or which errors are reported (more on this
276+
in the next chapter) are omitted.
276277
- It is general—describing the result for all inputs the author
277278
intends to support—so it can be applied in reasoning about any call
278279
to the function.

0 commit comments

Comments
 (0)