Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#8929 closed bug (invalid)

Deriving Generics broken

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Generics Cc:
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:

Description (last modified by hvr)

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.

Change History (7)

comment:1 Changed 5 years ago by dreixel

What is the error message that you get?

comment:2 Changed 5 years ago by kosmikus

I cannot reproduce this (with binary- Additionally, it also seems to work with 7.8.1-rc2.

comment:3 in reply to:  1 Changed 5 years ago by guest

Replying to 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
Last edited 5 years ago by hvr (previous) (diff)

comment:4 Changed 5 years ago by hvr

Description: modified (diff)

(fixed up Wiki markup)

comment:5 Changed 5 years ago by dreixel

I've just built GHC 7.6.3 with 7.6.3 (x86 linux), but I cannot reproduce this.

comment:6 Changed 5 years ago by hvr

Resolution: invalid
Status: newclosed

After talking to OP, I'm closing this as this was most likely caused by a broken installation/pkg-db

comment:7 Changed 3 years ago by RyanGlScott

Keywords: Generics added
Note: See TracTickets for help on using tickets.