
#13759: Strange error message for deriving Data -------------------------------------+------------------------------------- Reporter: alanz | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following code {{{#!hs {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} import Data.Data data Pass = Parsed | Renamed | Typechecked deriving (Data) data GHC (c :: Pass) deriving instance Data (GHC 'Parsed) deriving instance Data (GHC 'Renamed) deriving instance Data (GHC 'Typechecked) -- Type synonyms as a shorthand for tagging type GhcPs = GHC 'Parsed type GhcRn = GHC 'Renamed type GhcTc = GHC 'Typechecked }}} loads fine in `ghci-8.2.0.20170507`. In `ghc-8.0.2` and current master (as at https://github.com/ghc/ghc/tree/wip/new-tree-one-param-2) it gives {{{#!hs alanz@alanz-laptop:~/tmp/ghc-bug-data-deriving$ ghci-8.0.2 Main.hs GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/alanz/.ghci [1 of 1] Compiling Main ( Main.hs, interpreted ) Main.hs:16:1: error: Multiple declarations of ‘$tFl4AgeEJ0Vk5ONrnm56S3r’ Declared at: Main.hs:16:1 Main.hs:17:1 Main.hs:16:1: error: Multiple declarations of ‘$tFl4AgeEJ0Vk5ONrnm56S3r’ Declared at: Main.hs:15:1 Main.hs:17:1 Main.hs:16:1: error: Duplicate type signatures for ‘$tFl4AgeEJ0Vk5ONrnm56S3r’ at Main.hs:15:1-36 Main.hs:16:1-37 Main.hs:17:1-41 Failed, modules loaded: none. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13759 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler