E0043: write_to_loop_copy
E0043 write_to_loop_copy — a write to a loop variable, which is a copy.
A compile-time error of soma check, the checker of the Soma programming language (soma explain E0043).
The rule
In for line in lines { … } the loop variable is a copy of the element, so a write such as line.price = … is lost when the iteration ends unless the copy is used afterwards. soma check 3.1.0 reports this as the warning W0014 rather than under E0043. To keep the change, loop over indices and write the element back: for i in range(0, len(lines)) { let line = lines[i] line.price = … lines[i] = line }.
When you see it
The checker raises this rule with its habit flag set, so soma check 3.1.0 always reports it as the warning W0014 (habit_warning), never as E0043 — in edition 2026 and in edition 2027 alike. No program makes soma check print E0043.