Logic · rule
type.divisor_zero
Divisor may be zero.
Area 3, Logic; not declinable; the next step is usually the agent's.
A divisor's type excludes zero, so division by zero is ruled out while compiling:
type Stock = Int { min: 0}function split_evenly(total: Stock, portions: Stock) -> Stock { return Stock(total / portions)}
error: `portions` may be zero --> main.jadpo:6:26 |6 | return Stock(total / portions) | ^^^^^^^^ a `Stock` can be `0` reason: Division by zero is ruled out while compiling: a divisor's type excludes zero, as `Int { min: 1 }` does, and `Stock` allows `0`. next: Divide by a value whose type excludes zero, building it with its constructor where the zero case is handled (agent) rule: type.divisor_zero help: https://jadpo.dev/docs/errors/type.divisor_zerocheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/type.divisor_zero.md.Built from Jadpo main at a707efb.