RecordWildCards panic
GHC 7.4.1 (Debian 7.7 and Ubuntu 12.04.5 LTS) panics with:
ghc: panic! (the 'impossible' happened)
(GHC version 7.4.1 for i386-unknown-linux):
compiler/rename/RnPat.lhs:535:39-79: Irrefutable pattern failed for pattern gres@(gre : _)
I found a minimal test case to exemplify this issue:
module Foo where
import Bar (Bar (Bar))
foo :: Bar -> ()
foo Bar {..} = ()
module Bar where
data Bar = Bar { barA :: Int, barB :: Int }
A workaround is to import all data fields in module Foo:
import Bar (Bar (..))
I also tried this with GHC 7.6.3 (Mac OS X), with no warnings nor errors.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |