syntax.fails_after_result
Fails list comes after the result type.
Area 4, Failures; not declinable; the next step is usually the agent's.
type Title = Text { max_length: 200}type TitleBlank = Failure { kind: FailureKind.invalid_value message: "Enter a title."}function check_title(title: Title) -> Title fails TitleBlank { if (title == "") { reject TitleBlank } return title}
error fails goes before ->
--> main.jadpo:10:45
|10 | function check_title(title: Title) -> Title fails TitleBlank { | ^^^^^^^^^^^^^^^^ after the result type
- reason
- A signature says what can fail before what it returns:
fails A, B -> Result. - next
- Move
fails TitleBlankbefore->(agent) - rule
- syntax.
fails_ after_ result - help
- https://jadpo.
dev/docs/errors/syntax. fails_ after_ result
Markdown for agents: /docs/errors/syntax.fails_after_result.md.Built from Jadpo main at aee2e8f.