Logic · rule
type.ordering_operand
Values cannot be ordered.
Area 3, Logic; not declinable; the next step is usually the agent's.
A nullable value has to be matched before it can be compared:
type Count = Int {}type Flag = Bool {}function over_maximum(count: Count?, maximum: Count) -> Flag { return Flag(count > maximum)}
error: `count` may be `none`, so it can't be ordered --> main.jadpo:6:17 |6 | return Flag(count > maximum) | ^^^^^ may be `none` reason: `count` is `Count?`; `<`, `<=`, `>` and `>=` order two values, and `none` has no place in an order. next: Match on `count` and compare inside `some(...)` (agent) rule: type.ordering_operand help: https://jadpo.dev/docs/errors/type.ordering_operandcheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/type.ordering_operand.md.Built from Jadpo main at a707efb.