[GHC] #12854: ghc-8 prints mangled names in error message: ‘GHC.Base.$dm<$’

GHC ghc-devs at haskell.org
Sat Nov 19 15:51:40 UTC 2016


#12854: ghc-8 prints mangled names in error message: ‘GHC.Base.$dm<$’
-------------------------------------+-------------------------------------
           Reporter:  slyfox         |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 Noticed on old omega codebase when built with ghc-8.0.2-rc1.
 Here is the minimal example:

 {{{#!hs
 {-# 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:
 {{{#!hs
 {-# 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.
 }}}

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


More information about the ghc-tickets mailing list