[GHC] #3805: Bad error message "Invalid type signature"

GHC trac at galois.com
Tue Jan 5 03:21:36 EST 2010


#3805: Bad error message "Invalid type signature"
--------------------------------+-------------------------------------------
  Reporter:  asuffield          |          Owner:                  
      Type:  bug                |         Status:  new             
  Priority:  normal             |      Milestone:                  
 Component:  Compiler (Parser)  |        Version:  6.12.1          
Resolution:                     |       Keywords:                  
Difficulty:                     |             Os:  Unknown/Multiple
  Testcase:                     |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown       |  
--------------------------------+-------------------------------------------
Changes (by simonpj):

  * difficulty:  =>

Comment:

 Can you say what would be better?

 GHC parses
 {{{
 <expr> :: <type>
 }}}
 and then rejects the program with the above message if `<expr>` is not a
 plain variable.  (You may ask why it isn't just `<variable>` on the left
 then.  There's a good reason, but if we had `<variable>` on the left you'd
 just get the even more uninformative message "`Parse error`".)

 What would you ''like'' the message to say?  "Parse error in type
 signature"?  Or what?

 Regardless of your answer, it might be cool to spot cases which start with
 "`foreign`" and suggest the appropriate flag.  But what if you said
 {{{
 f g :: Int
 }}}
 having perhaps mis-typed "`f,g::Int`"?

 Simon

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


More information about the Glasgow-haskell-bugs mailing list