failure.reject_placement
Reject is used inside an expression.
Area 3, Logic; not declinable; the next step is usually the agent's.
reject stops the callable, so it starts a statement or ends a match arm,
never part of a value (question 11):
type Count = Int {}type CountRefused = Failure { kind: FailureKind.rejected}function capped(count: Count) fails CountRefused -> Count { var checked: Count = reject CountRefused return checked}
error reject can only start a statement
--> main.jadpo:8:26
|8 | var checked: Count = reject CountRefused | ^^^^^^ inside an expression
- reason
- Every place a callable can stop early is at the start of a line:
rejectis a statement of its own, or the result of amatcharm, never part of a value. - next
- Move
rejectto a line of its own, under anifor as amatcharm (agent) - rule
- failure.
reject_ placement - help
- https://jadpo.
dev/docs/errors/failure. reject_ placement
Markdown for agents: /docs/errors/failure.reject_placement.md.Built from Jadpo main at aee2e8f.