[GHC] #8204: Impossible when deriving Read for empty data declaration

#8204: Impossible when deriving Read for empty data declaration ------------------------------------+------------------------------------- Reporter: tinctorius | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Remember #4302? 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8204 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8204: Impossible when deriving Read for empty data declaration -------------------------------------+------------------------------------ Reporter: tinctorius | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by tinctorius): Of course I mean {{{ -- Ugh, fine... {-# LANGUAGE StandaloneDeriving #-} data X deriving instance Read X main :: IO () main = return () }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8204#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8204: Impossible when deriving Read for empty data declaration -------------------------------------+------------------------------------ Reporter: tinctorius | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by tinctorius): * status: new => closed * resolution: => duplicate Comment: Found the reference to #7931 in `compiler/typecheck/TcGenDeriv`. Sorry for the duplicate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8204#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC