Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceErrors

ErrorsLogic · rule

type.assign_immutable

On this page

A variable declared without mut, or a parameter, is given a new value.

Area 3, Logic; not declinable; the next step is usually the agent's.

Why Jadpo refuses it

A var never changes, so a reader who sees its line knows its value everywhere below it. Only a var mut can be pointed at a new value, and the mut warns the reader to look for where it changes. Parameters never change either. Letting a plain var change would break what its line promises.

What it looks like

main.jadpo:

example
type Choice = Text {}function replace(initial: Choice, replacement: Choice) -> Choice {    var fixed: Choice = initial    fixed = replacement    return fixed}
jadpo checkcheck failed: 1 error, 1 file

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_immutable

(agent) at the end of the next: line means your coding agent can make the fix itself.

Assigning a parameter is the same error:

main.jadpo:

example
type Choice = Text {}function replace(initial: Choice, replacement: Choice) -> Choice {    initial = replacement    return initial}
jadpo checkcheck failed: 1 error, 1 file

error initial can't be changed

--> main.jadpo:4:5

  |3 | function replace(initial: Choice, replacement: Choice) -> Choice {  |                  ------- a parameter4 |     initial = replacement  |     ^^^^^^^ assigned here
reason
Parameters never change; only a var mut can be pointed at a new value.
next
Copy initial into a var mut with a name of its own, and change that (agent)
rule
type.assign_immutable
help
https://jadpo.dev/docs/errors/type.assign_immutable

How to fix it

If the variable is meant to change, declare it var mut:

example
    var mut fixed: Choice = initial

fixed starts as initial and is then pointed at replacement. It can only ever hold a Choice.

If a parameter is meant to change, copy it into a var mut with a name of its own, and change that:

example
    var mut chosen: Choice = initial    chosen = replacement    return chosen

initial keeps the value the caller passed, and chosen is the one that changes.

Markdown for agents: /docs/errors/type.assign_immutable.md.Built from Jadpo main at aee2e8f.