Opened 9 years ago

Closed 9 years ago

#1121 closed bug (wontfix)

Error message "Expecting a function type, but found `w_a1Kh'"

Reported by: huschi@… Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by simonpj)

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:

    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.

Change History (1)

comment:1 Changed 9 years ago by simonpj

  • Description modified (diff)
  • Resolution set to wontfix
  • Status changed from new to closed

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.

Note: See TracTickets for help on using tickets.