B8007: contract not checked at run time
Catalog status: active. Default severity: warning. Stable name: contract-not-checked. Family: Warnings and assumptions.
A build without proof (--no-prove) checks contracts when the program runs instead of proving them, and erases ghost code unless advisory mode keeps it. This warning identifies preconditions, postconditions, assertions (pragma Assert) and loop invariants whose calls to erased ghost subprograms prevent runtime evaluation. A contract that is omitted at runtime supplies no executable validation of the property, even if its source spelling remains in the program.
B8007 is not the only thing such a build leaves unchecked: it has no run-time checks for leaks, variants, pragma Assume, the predefined library's assertions or postconditions whose 'Old values hold access values, and it does not warn of those. Read the mode guarantees and limits before relying on a development build's checking behavior.
Example (Vada)
function Is_Even (X : Integer) return Boolean is (X mod 2 = 0) with Ghost;
function Double (X : Integer) return Integer
with Post => Is_Even (Double'Result); -- calls a ghost functionExample (Varc)
ghost fn Is_Even(X: Integer) -> Boolean = X %% 2 == 0;
fn Double(X: Integer) -> Integer
ensures Is_Even(Double::Result); // calls a ghost function
What to do
Establish the property by strict proof, or write a supported executable validation that does not depend on erased state. Advisory mode retains ghost code and can evaluate supported ghost-dependent contracts; it still does not turn every specification obligation into an executable check. Verify the relevant behavior explicitly when runtime enforcement is part of your design.
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See warnings and assumptions, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.