syntax.mapping_block_required
Mappings are written after the call instead of in a block.
Area 4, Failures; not declinable; the next step is usually the agent's.
An attempt's mappings go in a block after the call, never after it on the
same line:
type Quantity = Int { min: 1 max: 1000}type QuantityTooLarge = Failure { kind: FailureKind.invalid_value}function doubled(quantity: Quantity) fails QuantityTooLarge -> Quantity { var result: Quantity = attempt Quantity(quantity * 2) invalid: QuantityTooLarge return result}
error An attempt's mappings go in a block after the call
--> main.jadpo:11:59
|11 | var result: Quantity = attempt Quantity(quantity * 2) invalid: QuantityTooLarge | ^^^^^^^^^^^^^^^^^^^^^^^^^ after the call, not in a block
- reason
- An
attemptmaps its failures in a block, one per line, the same form writes and integration calls use; a construction's keys are the rules that can break, withinvalid:covering the rest. - next
- Move
invalid: QuantityTooLargeinto a block after the call:{ invalid: QuantityTooLarge }(agent) - rule
- syntax.
mapping_ block_ required - help
- https://jadpo.
dev/docs/errors/syntax. mapping_ block_ required
Markdown for agents: /docs/errors/syntax.mapping_block_required.md.Built from Jadpo main at aee2e8f.