Opened 4 years ago

Closed 4 years ago

#10471 closed bug (duplicate)

Confusing parse error when forgetting "deriving"

Reported by: AlexanderThiemann Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: #8612 Differential Rev(s):
Wiki Page:


This code:

module Main where

data Foo
    = Foo
    { f_x :: Int
    , f_y :: Int
    } (Eq, Show)

Produces this error message:

foo.hs:5:7: Not in scope: `f_x'

foo.hs:6:7: Not in scope: `f_y'

I'm not sure how easy it is to improve the error message; but a "Not in scope" seems very confusing to me...

Change History (1)

comment:1 Changed 4 years ago by thomie

Resolution: duplicate
Status: newclosed

With 7.8 or newer you'd get:

test.hs:5:6: error:
    Record syntax is illegal here: {f_x :: Int, f_y :: Int}

test.hs:5:8: error: Not in scope: ‘f_x’

test.hs:6:8: error: Not in scope: ‘f_y’

This was reported before, in #8612, and then closed as "not ideal, but acceptable".

Note: See TracTickets for help on using tickets.