Strange error message for deriving Data
The following code
{-# 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
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.
Trac metadata
Trac field | Value |
---|---|
Version | 8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |