Logic · rule
syntax.increment_operator
Variable changed with ++, -- or +=.
Area 3, Logic; not declinable; the next step is usually the agent's.
A var mut changes with =, and a named type converts the result back with its constructor.
type Count = Int { min: 0}function bumped(count: Count) -> Count { var mut next: Count = count next++ return next}
error: Jadpo writes `next = next + 1`, not `next++` --> main.jadpo:7:9 |7 | next++ | ^^ write `next = next + 1` reason: `++`, `--`, `+=`, `-=` and `*=` change a variable in place in JavaScript, Java, C#, Go, Kotlin, Swift and Python; Jadpo assigns a `var mut` with `=`, and a named type converts the result back with its constructor, as in `count = Count(count + 1)`. next: Write `next = next + 1` (agent) rule: syntax.increment_operator help: https://jadpo.dev/docs/errors/syntax.increment_operatorcheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/syntax.increment_operator.md.Built from Jadpo main at a707efb.