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

impossible happened when desugaring #259

Open
gteege opened this issue Nov 19, 2018 · 1 comment
Open

impossible happened when desugaring #259

gteege opened this issue Nov 19, 2018 · 1 comment

Comments

@gteege
Copy link
Contributor

gteege commented Nov 19, 2018

The compiler asked me to report this...

When compiling the following cogent source with cogent -g
pattern.txt

the compiler output was
log.txt

@vjackson725
Copy link
Contributor

vjackson725 commented Nov 19, 2018

@zilinc I've replicated the failure and worked out what's causing it. Here's an even simpler program which reproduces the error.

m: () -> ()
m b =
  b | () -> ()
    | _ -> ()

Essentially, the compiler assumes that if there are multiple alternatives, none of them are irrefutable (Desugar.hs:307). I'm not sure this is a good assumption, given cases like the above; maybe we should replace it with a warning/error?

vjackson725 added a commit that referenced this issue Nov 19, 2018
@zilinc zilinc self-assigned this Nov 20, 2018
zilinc pushed a commit that referenced this issue Nov 20, 2018
@zilinc zilinc removed their assignment Apr 3, 2019
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

3 participants