[GHC] #13755: GHC-8.0.2+ spits out $dm names in error messages

GHC ghc-devs at haskell.org
Thu May 25 20:08:19 UTC 2017


#13755: GHC-8.0.2+ spits out $dm names in error messages
-------------------------------------+-------------------------------------
        Reporter:  zilinc            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10087            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:   => #10087


Comment:

 #10087 is very closely related to this ticket. The context of #10087 is a
 bit different since it was talking about `DefaultSignatures`, e.g.,

 {{{#!hs
 {-# LANGUAGE DefaultSignatures #-}

 class C a where
   reflexive :: a -> Bool
   default reflexive :: Eq a => a -> Bool
   reflexive x = x == x

 data D

 instance C D where
 }}}
 {{{
 /home/abel/play/haskell/bugs/DefaultSig.hs:10:10:
     No instance for (Eq D) arising from a use of ‘Main.$gdmreflexive’
     In the expression: Main.$gdmreflexive
     In an equation for ‘reflexive’: reflexive = Main.$gdmreflexive
     In the instance declaration for ‘C D’
 }}}

 The consensus on that ticket is that we should instead print an error
 message to the effect of:

 {{{
     No instance for (Eq D) arising from
        the generic default method for `reflexive`
     In the instance declaration for ‘C D’
 }}}

 Following the same principle, I think an ideal error message for your
 particular example would be:

 {{{
     • Overlapping instances for Arbitrary Int
         arising from a default implementation of `shrink`
         ...
     • In the instance declaration for ‘Arbitrary Int’
 }}}

 Do you agree, zilinc?

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


More information about the ghc-tickets mailing list