[GHC] #9173: Better type error messages

GHC ghc-devs at haskell.org
Mon Sep 28 22:04:58 UTC 2015


#9173: Better type error messages
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
-------------------------------------+-------------------------------------

Comment (by chreekat):

 Replying to [comment:12 simonpj]:
 >
 > Switching the order as Reid suggests in comment:11 would be easy, and I
 can see that it might help.  Do others like that?
 >
 > I'd also be ok with saying "type expected by the context" instead of
 just "expected".   That longer phrase would also suggest putting it
 second.

 +1. E.g.:

 {{{
 foo.hs:1:11:
     Couldn't match actual type ‘Char’ with type expected by context,
 ‘Bool’
     In the first argument of ‘not’, namely ‘'c'’
     In the expression: not 'c'
     In an equation for ‘foo’: foo = not 'c'
 }}}

 (I recall now that "In the expression" is used because the message often
 *does* refer to a component of the whole expression. Still, I think it
 would be nice if it switched to "In the expression" when referring to the
 whole thing.)

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


More information about the ghc-tickets mailing list