soma.cell

E0028: undefined_variable

E0028 undefined_variable — a name with no let, parameter, loop variable, match binding or slot.

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

The rule

E0028 (undefined_variable) names the rule that every name must be a let, parameter, loop variable, match binding or memory slot in scope. With soma 3.1.0, soma check reports an undefined name under E0011 (interpolation_undefined) instead, both inside and outside strings, with the message "undefined variable '…' — no let, parameter, loop variable, match binding or memory slot with that name is in scope" and a "did you mean" suggestion when a close name exists. Fix it by binding the name before its use or correcting its spelling; see E0011 for a checked example.

When you see it

soma 3.1.0's checker routes every undefined_variable finding (checker/interpolation_check.rs) into CheckError::InterpolationUndefined (checker/mod.rs, the interpolation loop), which is reported as E0011; no path in soma check emits E0028. The name undefined_variable survives only as a runtime error kind (soma run / soma serve).