Stack overflow with trivial code #68

Open
Daniel-Diaz opened this Issue Jul 29, 2013 · 4 comments

Comments

Projects
None yet
3 participants

The code below gives me stack overflow when evaluating foo in GHCi.

{-# LANGUAGE DeriveGeneric #-}

import GHC.Generics
import Data.Hashable
import Data.HashSet

data Foo = Foo deriving (Eq, Generic)

instance Hashable Foo

foo = member Foo empty

Is this expected?

GHCi version 7.6.3.
unordered-containers version 0.2.3.1.

GHCi version 7.6.3
unordered-containers version 0.2.3.0

stack overflow, too

ps:

hash Foo
also stack overflow, so I think this is a bug of hashable Foo

instance Hashable Foo where
hash Foo = 1

will be okay

Owner

tibbe commented Mar 5, 2014

So the problem is most likely with Generic deriving. Unfortunately I don't know that code well as I didn't write it, so it'll take a bit longer until I get to it. Any extra debug info (e.g. what does the derived code look like) would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment