type.match_wildcard_closed
Wildcard on a value whose cases can be listed.
Area 3, Logic; not declinable; the next step is usually the agent's.
An enum, a Bool or a nullable value lists every case, so a case added later is caught:
function describe(state: DeliveryState) -> Label { return match state { DeliveryState.pending -> "Pending" _ -> "Other" }}
error _ can't stand for the rest of a DeliveryState
--> main.jadpo:4:9
|4 | _ -> "Other" | ^ wildcard
- reason
- On enums,
Booland nullable values every case is listed, so a case added later is caught at everymatchthat has to consider it. - next
- Replace
_with arms forDeliveryState.sentandDeliveryState.failed(agent) - rule
- type.
match_ wildcard_ closed - help
- https://jadpo.
dev/docs/errors/type. match_ wildcard_ closed
Markdown for agents: /docs/errors/type.match_wildcard_closed.md.Built from Jadpo main at aee2e8f.