Sakura Lang

D021 postcondition_violated

An ensures clause failed on normal return.

A runtime defect: the running program stops with it; no compile phase reports it, and try cannot catch it. sakura explain D021 prints this explanation offline.

An ensures clause failed on normal return. The callee is blamed: fix the function body, or weaken the clause if it promises more than the function can deliver. sakura test --contracts and sakura verify look for such inputs before the program runs.

Runtime defects come from running programs, so compiler/tests/ui has no fixture for them; the explanation above names the repair.

Edit on GitHub