[GHC] #13582: Confusing error message with multiparameter type classes.

GHC ghc-devs at haskell.org
Tue Apr 18 07:57:26 UTC 2017


#13582: Confusing error message with multiparameter type classes.
-------------------------------------+-------------------------------------
        Reporter:                    |                Owner:  (none)
  facundo.dominguez                  |
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  type-checking
                                     |  errors multiparameter type classes
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Are you saying that GHC 7.8's error message is better because it mentions
 `b` rather than `b0`?

 HEAD also use `b0` rather than `b`.   Really there are two unsolved
 constraint:
 {{{
                 [WD] $dFirst_a2yX {1}:: First Int b0_a2yW[tau:1] Int
 (CDictCan)
                 [WD] $dTypeable_a2yY {1}:: Typeable b0_a2yW[tau:1]
 (CDictCan)
 }}}
 Both mention the same unification variable. I don't know why 7.8 reports
 it differently.

 But you are right.  The Big Thing is that ''unification variables
 currently do not record their origin''.  Would it be better to say this?
 {{{
   b0 is a unification variable arising from instantiating
   the call to 'second' on line 18
 }}}
 But actually even that is not right.  `b0` arises from using the instance
 declaration to simplify the constraint `Second Int Int`, which itself
 arises from the call to `second`.

 What would you LIKE it to say?

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


More information about the ghc-tickets mailing list