cogent
cogent copied to clipboard
impossible happened when desugaring
The compiler asked me to report this...
When compiling the following cogent source with cogent -g pattern.txt
the compiler output was log.txt
@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?