[GHC] #7856: Wrong error message for unknown Instance

GHC cvs-ghc at haskell.org
Tue Apr 23 18:14:09 CEST 2013


#7856: Wrong error message for unknown Instance
------------------------------------------------+---------------------------
  Reporter:  bas                                |          Owner:                  
      Type:  feature request                    |         Status:  closed          
  Priority:  normal                             |      Milestone:  _|_             
 Component:  Compiler (Type checker)            |        Version:  7.6.3           
Resolution:  invalid                            |       Keywords:  Instance        
        Os:  Unknown/Multiple                   |   Architecture:  Unknown/Multiple
   Failure:  Incorrect warning at compile-time  |     Difficulty:  Unknown         
  Testcase:                                     |      Blockedby:                  
  Blocking:                                     |        Related:                  
------------------------------------------------+---------------------------
Changes (by monoidal):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 > I would not expect the "actual type" to be "String -> ()", but rather
 "IO ()".

 You do get "IO ()", at least on 7.6.2 and HEAD:

 {{{
     Couldn't match expected type ‛String -> IO ()’
                 with actual type ‛IO ()’
     In the return type of a call of ‛sequence_’
     Probable cause: ‛sequence_’ is applied to too many arguments
     In the expression: sequence_ lst
     In an equation for ‛tmp’: tmp = sequence_ lst
 }}}

 Given {{{tmp :: String -> IO (); tmp = sequence_ lst}}} the error message
 is clear: `sequence_ lst` is `IO ()` while the signature is `String -> IO
 ()`.

 I'm closing the ticket, but please reopen if you disagree.

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



More information about the ghc-tickets mailing list