Failures · rule
failure.rule_unmapped
Rule that can break has no arm and no catch-all.
Area 4, Failures; not declinable; the next step is usually the agent's.
Each rule a construction can break has an arm, or invalid: covers it:
type Count = Int {}type Quantity = Int { min: 1 max: 1000}type QuantityTooLarge = Failure { kind: FailureKind.invalid_value}function from_count(n: Count) fails QuantityTooLarge -> Quantity { var result: Quantity = attempt Quantity(n) { max: QuantityTooLarge } return result}
error: `Quantity(...)` can break `min`, and nothing maps it --> main.jadpo:13:28 |13 | var result: Quantity = attempt Quantity(n) { | ^^^^^^^^^^^^^^^^^^^^^ can fail at runtime reason: The value is only known when the program runs, and neither the declared ranges nor a condition before it prove it follows `min: 1`; it needs an arm naming the `invalid_value` failure the caller gets, or `invalid:` covers every rule without its own. next: Add `min: SomeFailure` to the block, naming an `invalid_value` failure, or `invalid: SomeFailure` to cover every rule without an arm (agent) rule: failure.rule_unmapped help: https://jadpo.dev/docs/errors/failure.rule_unmappedcheck failed: 1 error, 1 file
Markdown for agents: /docs/errors/failure.rule_unmapped.md.Built from Jadpo main at a707efb.