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

report uncovered patterns #172

Merged
merged 1 commit into from
Jun 6, 2024
Merged

report uncovered patterns #172

merged 1 commit into from
Jun 6, 2024

Conversation

vekatze
Copy link
Owner

@vekatze vekatze commented Jun 6, 2024

data sample {
| Foo
| Bar(int, int)
| Qux
| Buz(tau)
}

define foo(p: pair(list(int), sample)): unit {
  match p {
  | Pair(Cons(_, _), Foo) =>
    Unit
  | Pair(Nil, Bar(_, _)) =>
    Unit
  }
}

(before)

/path/to/file.nt:9:3
Error: Encountered a non-exhaustive pattern matching

(after)

/path/to/file.nt:9:3
Error: This pattern matching does not cover:
       - Pair(Cons(_, _), Bar(_, _))
       - Pair(Cons(_, _), Buz(_))
       - Pair(Cons(_, _), Qux)

@vekatze vekatze marked this pull request as ready for review June 6, 2024 09:03
@vekatze vekatze merged commit 2b33ed9 into main Jun 6, 2024
1 check passed
@vekatze vekatze deleted the report-uncovered-patterns branch June 6, 2024 09:03
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.

None yet

1 participant