ghc-8 prints mangled names in error message: ‘GHC.Base.$dm<$’
Noticed on old omega codebase when built with ghc-8.0.2-rc1. Here is the minimal example:
{-# LANGUAGE FlexibleInstances, KindSignatures #-}
{-# OPTIONS_GHC -Wall #-}
data F a b
instance Functor (F a) where fmap = undefined
instance Functor (F String) where fmap = undefined
$ ghci a.hs
GHCi, version 8.0.1.20161117: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/slyfox/.ghci
[1 of 1] Compiling Main ( a.hs, interpreted )
a.hs:6:10: error:
• Overlapping instances for Functor (F String)
arising from a use of ‘GHC.Base.$dm<$’
Matching instances:
instance Functor (F a) -- Defined at a.hs:5:10
instance Functor (F String) -- Defined at a.hs:6:10
• In the expression: GHC.Base.$dm<$ @F String
In an equation for ‘<$’: (<$) = GHC.Base.$dm<$ @F String
In the instance declaration for ‘Functor (F String)’
Failed, modules loaded: none.
‘GHC.Base.$dm<$’ is an internal name. Looks like it should be a 'GHC.Base.<$'.
Confusingly this does not cause overlapping error at all:
{-# LANGUAGE FlexibleInstances, KindSignatures #-}
{-# OPTIONS_GHC -Wall #-}
data F a b
class C (f :: * -> *) where
instance C (F a) where
instance C (F String) where
$ ghci a.hs
GHCi, version 8.0.1.20161117: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/slyfox/.ghci
[1 of 1] Compiling Main ( a.hs, interpreted )
Ok, modules loaded: Main.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |