Ticket #165 (closed defect: invalid)

Opened 4 years ago

Last modified 6 months ago

Parse error on comment before opening brace of record

Reported by: Mathnerd314 Owned by:
Priority: minor Milestone:
Version: 2.8.1 Keywords:
Cc:

Description

This gives "parse error on input `{'":

data Test =
    Test
        -- | A value
        { a :: Int
        -- | Another value
        , b :: Int
        }

This does not:

data Test =
    Test
        { -- | A value
          a :: Int
        , -- | Another value
          b :: Int
        }

The first should parse and give the same result as the second.

Change History

Changed 22 months ago by anonymous

  • milestone 2.9.0 deleted

Milestone 2.9.0 deleted

Changed 6 months ago by Fūzetsu

  • status changed from new to closed
  • resolution set to invalid

No, it shouldn't. The first way attaches the comment to the block (and we don't know what that means so it's a parse error) while the second correctly attaches it to the field. If anything, this needs to be a GHC-side change.

Note: See TracTickets for help on using tickets.