Opened 3 years ago

Last modified 16 months ago

#13438 new bug

ghci :browse does not work with DuplicateRecordFields

Reported by: rik Owned by:
Priority: normal Milestone:
Component: GHCi Version: 8.0.2
Keywords: duplicaterecordfields ghci orf Cc: adamgundry
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by rik)

Using :browse on module which has enabled DuplicateRecordFields and datatypes are exported, does not return the field accessor functions.

So for example:

data Login = Login
  { code     :: Text
  , password :: Text

browse for module does not return code and password accessor functions.

Change History (3)

comment:1 Changed 3 years ago by rik

Description: modified (diff)

comment:2 Changed 2 years ago by adamgundry

Cc: adamgundry added
Keywords: orf added

comment:3 Changed 16 months ago by adamgundry

I've taken an initial look at this. FWIW it seems I need :browse! to observe the difference.

The problem is that browseModule uses modInfoExports or modInfoTopLevelScope, both of which omit record fields defined with DuplicateRecordFields. To change this browseModule needs to be modified to work with a mixture of Names and FieldLabels, which is a bit of pain. I'm thinking about how to redesign things to make this easier...

Note: See TracTickets for help on using tickets.