[GHC] #8929: Deriving Generics broken

#8929: Deriving Generics broken ----------------------------------+------------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+------------------------------------- I load the following code into ghci: == {-# LANGUAGE DeriveGeneric #-} import GHC.Generics import Data.Binary data Foo = Foo deriving (Show, Generic) instance Binary Foo == Then I execute: (decode . encode $ Foo) :: Foo In 7.6.3 (stage 2 booted 7.6.3), I get an error. In 7.6.3 (stage 2 booted 7.6.2), the desired result "Foo" is shown. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by dreixel): What is the error message that you get? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by kosmikus): I cannot reproduce this (with binary-0.7.1.0). Additionally, it also seems to work with 7.8.1-rc2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by guest): Replying to [comment:1 dreixel]:
What is the error message that you get?
during the compilation, I get the WARNING: No explicit method or default declaration for `put' In the instance declaration for `Binary Foo' When running the (decode . encode $ Foo), I get the EXCEPTION: No instance nor default method for class operation Data.Binary.get -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Old description:
I load the following code into ghci:
== {-# LANGUAGE DeriveGeneric #-}
import GHC.Generics import Data.Binary
data Foo = Foo deriving (Show, Generic)
instance Binary Foo ==
Then I execute:
(decode . encode $ Foo) :: Foo
In 7.6.3 (stage 2 booted 7.6.3), I get an error.
In 7.6.3 (stage 2 booted 7.6.2), the desired result "Foo" is shown.
New description: I load the following code into ghci: {{{#!hs {-# LANGUAGE DeriveGeneric #-} import GHC.Generics import Data.Binary data Foo = Foo deriving (Show, Generic) instance Binary Foo }}} Then I execute: {{{#!hs (decode . encode $ Foo) :: Foo }}} In 7.6.3 (stage 2 booted 7.6.3), I get an error. In 7.6.3 (stage 2 booted 7.6.2), the desired result "Foo" is shown. -- Comment (by hvr): (fixed up Wiki markup) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by dreixel): I've just built GHC 7.6.3 with 7.6.3 (x86 linux), but I cannot reproduce this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+---------------------------------- Reporter: guest | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by hvr): * status: new => closed * resolution: => invalid Comment: After talking to OP, I'm closing this as this was most likely caused by a broken installation/pkg-db -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8929: Deriving Generics broken -------------------------------------+------------------------------------- Reporter: guest | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: invalid | Keywords: Generics Operating System: Unknown/Multiple | Architecture: x86_64 | (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => Generics -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8929#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC