soma.cell

E0094: ensure_after_return

E0094 ensure_after_return — ensure after a return never runs.

A compile-time error of soma check, the checker of the Soma programming language (soma explain E0094).

The rule

An ensure runs where it stands, so when a handler can return earlier, that return skips the postcondition and the write it was meant to guard is committed unchecked. soma check warns about an ensure placed after a possible return; this binary reports the warning as W0014 (habit_warning), not as E0094. Fix it by checking the condition before each early return, or by restructuring so every path falls through to the ensure.

When you see it

soma check never prints E0094: the checker creates this diagnostic as a habit warning, and every habit warning is reported under the warning code W0014 (habit_warning), in edition 2026 and 2027 alike.