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

cannot satisfy ability handler exhaustiveness check in presense of Void #5127

Open
ceedubs opened this issue Jun 24, 2024 · 1 comment
Open

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Jun 24, 2024

Describe and demonstrate the bug

Input:

```unison
foo : '{Abort} Void -> Text
foo f = handle f () with cases
  { r } -> absurd r
  { abort -> _ } -> "aborted"
```

The above fails to compile with the error message This case would be ignored because it's already covered by the preceding case(s)

However if you remove the { r } case then it fails with:

  Pattern match doesn't cover all possible cases:
        2 | foo f = handle f () with cases
        3 |   { abort -> _ } -> "aborted"
    
  
  Patterns not matched:
   * { _ }

Environment (please complete the following information):

  • ucm --version 05e2184
  • OS/Architecture: x86 NixOS

Additional context

This was previously investigated over a year ago and there are some details here.

@ceedubs
Copy link
Contributor Author

ceedubs commented Jul 5, 2024

Strangely, if you replace absurd r with a string literal, it compiles again. Perhaps if you don't reference r it infers a handler that is universal with respect to the return type, so it doesn't consider { r } to be an impossible case?

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

No branches or pull requests

1 participant