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 that uses nested type-constructors should not be considered redundant #205

Closed
julianhyde opened this issue Nov 21, 2023 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

The pattern

fun f (SOME (SOME i)) = i + 1
  | f (SOME NONE) = 0
  | f NONE = ~1

is currently flagged as redundant when it is not. After SOME i has been seen at depth 1 in the first line, the checker incorrectly believes that SOME at depth 0 in the second line has been covered already.

The fix is to generate different variables for the satisfiability checker: 1.SOME for the first (because it occurs within the type constructor number 1 (0- based)), and SOME for the second.

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

No branches or pull requests

1 participant