Opened 7 years ago

Closed 7 years ago

#2179 closed merge (fixed)

Improve error message when `main' is not of the right type

Reported by: amiddelk Owned by: igloo
Priority: normal Milestone: 6.10 branch
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Test Case: tcfail199
Blocked By: Blocking:
Related Tickets: Differential Revisions:


If you run the following module with GHC(i):

module Main where
main = "hi"

You get the error message:

Couldn't match expected type IO a' against inferred type [Char]'
In the first argument of GHC.TopHandler.runMainIO', namely main'
When checking the type of the function `main'

The error message would be a bit nicer if the second line was hidden.

Change History (4)

comment:1 Changed 7 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 6.10 branch

Agreed; thanks for the report!

comment:2 Changed 7 years ago by simonpj

  • Owner set to simonpj

I'm fixing this

comment:3 Changed 7 years ago by simonpj

  • Owner changed from simonpj to igloo
  • Type changed from proposal to merge

Fixed by

Thu Apr  3 10:37:46 PDT 2008  [email protected]
  * Fix Trac #2179: error message for main

Ian, can you add a test case please?


comment:4 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to tcfail199

Test added (tcfail199)

Note: See TracTickets for help on using tickets.