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

GHC trac at galois.com
Mon Jan 4 19:37:42 EST 2010


#3805: Bad error message "Invalid type signature"
---------------------------------+------------------------------------------
    Reporter:  asuffield         |       Owner:                   
        Type:  bug               |      Status:  new              
    Priority:  normal            |   Component:  Compiler (Parser)
     Version:  6.12.1            |    Keywords:                   
          Os:  Unknown/Multiple  |    Testcase:                   
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown     
---------------------------------+------------------------------------------
 The following line of code:

 {{{foreign export ccall foo :: IO ()}}}

 generates this error message:

 {{{TestErr.hs:1:0: Invalid type signature}}}

 (In this case, the programmer error was of course that the
 !ForeignFunctionInterface pragma is missing, and the parser has treated
 this as a definition of the function 'foreign'; this is a motivational
 example and not directly relevant to the issue)

 This error message is quite uninformative - and after looking at the code
 which generates it, I still can't figure out what kind of error it's
 supposed to be detecting. It should be changed to explain why the type
 signature appears to be invalid. Ideally, it would then be immediately
 apparent that the line has been parsed in an unexpected way.

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


More information about the Glasgow-haskell-bugs mailing list