Skip to content

Error message "not in scope" on missing 'deriving'

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 `(')
Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information