[GHC] #9173: Better type error messages

GHC ghc-devs at haskell.org
Fri Sep 25 07:16:18 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 Revisions:
-------------------------------------+-------------------------------------

Comment (by simonpj):

 The trouble with "declared type" is that it often isn't declared. Consider
 {{{
 not 'c'
 }}}
 The actual type of `'c'` is `Char`, but the type expected by the context
 (the call of `not`) is `Bool`.  But it'd be confusing to say that `Bool`
 was the "declared" type!

 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.

 Simon

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


More information about the ghc-tickets mailing list