[GHC] #10487: Unhelpful error from instance Generic

GHC ghc-devs at haskell.org
Thu Jun 4 18:22:04 UTC 2015


#10487: Unhelpful error from instance Generic
-------------------------------------+-------------------------------------
        Reporter:  andreas.abel      |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by andreas.abel):

 It is also a proper bug.
 {{{#!hs
 module M where

 data Name = Name
 }}}
 {{{#!hs
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE StandaloneDeriving #-}

 module N where

 import GHC.Generics
 import qualified M

 data Name = Name

 deriving instance Generic M.Name
 deriving instance Generic Name
 }}}
 Error:
 {{{
 [1 of 2] Compiling M                ( M.hs, interpreted )
 [2 of 2] Compiling N                (
 /home/abel/play/haskell/bugs/Generics/N.hs, interpreted )

 /home/abel/play/haskell/bugs/Generics/N.hs:1:1:
     Duplicate instance declarations:
       instance Datatype N.D1Name
         -- Defined at /home/abel/play/haskell/bugs/Generics/N.hs:1:1
       instance Datatype N.D1Name
         -- Defined at /home/abel/play/haskell/bugs/Generics/N.hs:1:1

 /home/abel/play/haskell/bugs/Generics/N.hs:1:1:
     Duplicate instance declarations:
       instance Constructor N.C1_0Name
         -- Defined at /home/abel/play/haskell/bugs/Generics/N.hs:1:1
       instance Constructor N.C1_0Name
         -- Defined at /home/abel/play/haskell/bugs/Generics/N.hs:1:1
 Failed, modules loaded: M.
 }}}
 Qualified names are not handled properly by DeriveGeneric.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10487#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list