Logic · rule
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, `Bool` and nullable values every case is listed, so a case added later is caught at every `match` that has to consider it. next: Replace `_` with arms for `DeliveryState.sent` and `DeliveryState.failed` (agent) rule: type.match_wildcard_closed help: https://jadpo.dev/docs/errors/type.match_wildcard_closedcheck failed: 1 error, 2 files
Markdown for agents: /docs/errors/type.match_wildcard_closed.md.Built from Jadpo main at a707efb.