#1121: Error message "Expecting a function type, but found `w_a1Kh'"
-------------------------------------+--------------------------------------
 Reporter:  [EMAIL PROTECTED]           |          Owner:         
     Type:  bug                      |         Status:  closed 
 Priority:  normal                   |      Milestone:         
Component:  Compiler (Type checker)  |        Version:  6.4.2  
 Severity:  normal                   |     Resolution:  wontfix
 Keywords:                           |     Difficulty:  Unknown
 Testcase:                           |   Architecture:  x86    
       Os:  Linux                    |  
-------------------------------------+--------------------------------------
Changes (by simonpj):

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

Old description:

> When compiling with GHC or loading into GHCi the following module I get a
> strange error:
>
> module Bla where
>
> bla :: String -> String
> bla x = unwords $ [ ('#':) ]
>
> The error is:
>
> Bug.hs:4:20:
>     Expecting a function type, but found `w_a1bp'
>       Expected type: String
>       Inferred type: [Char] -> [Char]
>     In the expression: ('#' :)
>     In the list element: ('#' :)
>
> Writing the function as:
>
> bla = words [ ('#':) ]
>
> produces the correct error message with [Char] instead of `w_a1bp'.
>
> I was doing this with GHC-6.4.2 on Ubuntu with a 2.6.17 kernel.

New description:

 When compiling with GHC or loading into GHCi the following module I get a
 strange error:
 {{{
 module Bla where

 bla :: String -> String
 bla x = unwords $ [ ('#':) ]
 }}}
 The error is:
 {{{
 Bug.hs:4:20:
     Expecting a function type, but found `w_a1bp'
       Expected type: String
       Inferred type: [Char] -> [Char]
     In the expression: ('#' :)
     In the list element: ('#' :)
 }}}
 Writing the function as:
 {{{
 bla = words [ ('#':) ]
 }}}
 produces the correct error message with [Char] instead of `w_a1bp'.

 I was doing this with GHC-6.4.2 on Ubuntu with a 2.6.17 kernel.

Comment:

 Happily, this is fine in GHC 6.6.  I don't think it's serious enough to
 fix in 6.4.  Thanks for reporting it though.  We always like to hear about
 poor error messages.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1121>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to