Logic · rule
type.assign_immutable
Value that never changes is assigned.
Area 3, Logic; not declinable; the next step is usually the agent's.
type Choice = Text {}function replace(initial: Choice, replacement: Choice) -> Choice { var fixed: Choice = initial fixed = replacement return fixed}
error: `fixed` can't be changed --> main.jadpo:5:5 |4 | var fixed: Choice = initial | ----- declared without `mut`5 | fixed = replacement | ^^^^^ assigned here reason: `var` names a value that never changes; only a `var mut` can be pointed at a new value. next: Declare it `var mut fixed` (agent) rule: type.assign_immutable help: https://jadpo.dev/docs/errors/type.assign_immutablecheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/type.assign_immutable.md.Built from Jadpo main at a707efb.