Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern Completeness: Warn about future clauses in scattered enums #825

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

Alasdair
Copy link
Collaborator

Now if matching on a scattered enum the completeness checker will warn about the possibility of future members:

Warning: Incomplete pattern match statement at warn_enum_open.sail:16.2-7:
16 |  match R {
   |  ^---^
   |
The following expression is unmatched: <future E clause>

Which effectively requires a wildcard case for such matches to be complete. After the end keyword closes the scattered definition this will no-longer be the case, as no new clauses can be added.

Now if matching on a scattered enum the completeness checker will warn
about the possibility of future members:
```
Warning: Incomplete pattern match statement at warn_enum_open.sail:16.2-7:
16 |  match R {
   |  ^---^
   |
The following expression is unmatched: <future E clause>
```
Which effectively requires a wildcard case for such matches to be complete.
After the `end` keyword closes the scattered definition this will no-longer
be the case, as no new clauses can be added.
Copy link

github-actions bot commented Dec 10, 2024

Test Results

   12 files  ±0     24 suites  ±0   0s ⏱️ ±0s
  733 tests +3    733 ✅ +3  0 💤 ±0  0 ❌ ±0 
2 461 runs  +3  2 460 ✅ +3  1 💤 ±0  0 ❌ ±0 

Results for commit 6293ed4. ± Comparison against base commit 25c76c8.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant