ErrorsValues and types · rule
type.rule_not_condition
Rule's condition isn't a Bool.
Area 2, Values and types; not declinable; the next step is usually the agent's.
A rule holds or it doesn't, so its condition is a Bool:
type Stock = Int { min: 0}type PriceBand = Object { low: Stock high: Stock rule spread: high - low}
error The rule spread isn't a condition
--> main.jadpo:8:18
|8 | rule spread: high - low | ^^^^^^^^^^ this is `Int`
- reason
- A rule holds for a value or it doesn't, so its condition is a
Bool: a comparison such ashigh > low, or several joined withand,orandnot. - next
- Write
spreadas a comparison ofPriceBand's fields (agent) - rule
- type.
rule_ not_ condition - help
- https://jadpo.
dev/docs/errors/type. rule_ not_ condition
Markdown for agents: /docs/errors/type.rule_not_condition.md.Built from Jadpo main at aee2e8f.