Opened 6 weeks ago

Last modified 6 weeks ago

#15849 new bug

Error message: "Perhaps you need a let in a do block", when there is no do block.

Reported by: cdsmith Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.4.3
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This code:

main = return ()
 foo = return ()

Gives the error message:

parse error on input ‘=’
    Perhaps you need a 'let' in a 'do' block?
    e.g. 'let x = 5' instead of 'x = 5'

But this isn't in a do block. It would be awesome if GHC checked whether there's a do block before giving a suggestion that depends on there being a do block.

Change History (1)

comment:1 Changed 6 weeks ago by bgamari

Keywords: newcomer added
Note: See TracTickets for help on using tickets.