Impossible when deriving Read for empty data declaration
Remember #4302 (closed)?
Me:
data X deriving Read
main :: IO ()
main = return ()
GHC:
[1 of 1] Compiling Main ( deriving.hs, deriving.o )
deriving.hs:2:17:
Can't make a derived instance of `Read X':
`X' must have at least one data constructor
Possible fix: use a standalone deriving declaration instead
In the data declaration for `X'
Me:
-- Ugh, fine...
{-# LANGUAGE StandaloneDeriving #-}
deriving instance Read X
main :: IO ()
main = return ()
GHC:
[1 of 1] Compiling Main ( deriving.hs, deriving.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.6.3 for x86_64-unknown-linux):
Prelude.foldr1: empty list
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
And so I did.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |