Opened 6 years ago
Closed 6 years ago
#8612 closed bug (fixed)
Error message "not in scope" on missing 'deriving'
Reported by: | mirpa | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | Compiler | Version: | 7.4.1 |
Keywords: | 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: |
Description
Incorrect definition like:
module Der where data A = A { a :: Int } (Show) -- missing deriving
gives error message:
der.hs:3:14: Not in scope: `a'
I had bigger data structure, where I concentrated on a :: Int
part between parentheses trying to figure out why a
is not defined. Missing deriving
could easily escape your eye in such case.
I would like to get something like:
der.hs:4:14: Unexpected `('
For instance Hugs says:
ERROR "der.hs":4 - Syntax error in input (unexpected `(')
Note: See
TracTickets for help on using
tickets.
In HEAD you get a bit better message
It's not ideal, but IMO it gives a good hint that the specific part
a::Int
is not the issue.