Checking Exhaustiveness After Adding a Variant

An exhaustive match handles every currently allowed form. Adding a new variant can reveal callers needing a decision about that case.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a queue event
  2. Make the change visible to callers

Trace a queue event

A routine already handles start and finish. Adding cancel requires reviewing transitions, logs, and display where those events were previously complete. See exhaustive conditions.

Make the change visible to callers

An indiscriminate default can treat the new event as an old one. Use an explicit unknown rule where evolution requires it. Pattern exhaustiveness explains coverage and redundancy tests.[1]

References

  1. Benjamin C. Pierce et al., Software Foundations ↩