Opened 9 years ago

Closed 9 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: None/Unknown Test Case: tcfail199
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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 9 years ago by igloo

difficulty: Unknown
Milestone: 6.10 branch

Agreed; thanks for the report!

comment:2 Changed 9 years ago by simonpj

Owner: set to simonpj

I'm fixing this

comment:3 Changed 9 years ago by simonpj

Owner: changed from simonpj to igloo
Type: proposalmerge

Fixed by

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

Ian, can you add a test case please?


comment:4 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed
Test Case: tcfail199

Test added (tcfail199)

Note: See TracTickets for help on using tickets.