Values and types · rule
type.mismatch
Value has the wrong type.
Area 2, Values and types; not declinable; the next step is usually the agent's.
type Stock = Int { min: 0}function add(a: Stock, b: Stock) -> Stock { return a + b}
error: `Int` can't be used where `Stock` is required --> main.jadpo:6:12 |6 | return a + b | ^^^^^ this is `Int` reason: Arithmetic works on the representation, so this is a plain `Int`; only `Stock(...)` makes it a `Stock`, checking its rules. next: Convert it with `Stock(a + b)` (agent) rule: type.mismatch help: https://jadpo.dev/docs/errors/type.mismatchcheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/type.mismatch.md.Built from Jadpo main at a707efb.