Opened 22 months ago

Closed 15 months ago

Last modified 15 months ago

#14487 closed bug (fixed)

Can't Hide Field When DuplicateRecordFields Is Enabled

Reported by: iansullivan88 Owned by:
Priority: lowest Milestone: 8.6.1
Component: Compiler Version: 8.0.2
Keywords: DuplicateRecordFields ORF Cc: adamgundry
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: GHC rejects valid program Test Case: rename/should_compile/T14487, 14487A, overloadedrecflds/should_fail/DuplicateExports
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D4805
Wiki Page:


A.hs fails to compile when DuplicateRecordFields is enabled in B.hs.


module A where

import           B hiding (duplicateName)

test = X duplicateName

duplicateName = 5


{-# LANGUAGE DuplicateRecordFields #-}

module B where

data X = X {
    duplicateName :: Int

Change History (6)

comment:1 Changed 16 months ago by RyanGlScott

Keywords: ORF added

comment:2 Changed 16 months ago by adamgundry

Cc: adamgundry added

comment:3 Changed 16 months ago by adamgundry

Differential Rev(s): Phab:D4805
Milestone: 8.6.1
Status: newpatch
Test Case: rename/should_compile/T14487

comment:4 Changed 15 months ago by Ben Gamari <ben@…>

In ccd8ce40/ghc:

Handle DuplicateRecordFields correctly in filterImports (fixes #14487)

filterImports needed a small adjustment to correctly handle record field
definitions arising from modules with DuplicateRecordFields enabled.

Previously hiding fields was not possible with DuplicateRecordFields enabled.

Test Plan: new test rename/should_compile/T14487

Reviewers: bgamari

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14487

Differential Revision:

comment:5 Changed 15 months ago by bgamari

Resolution: fixed
Status: patchclosed

comment:6 Changed 15 months ago by simonpj

Test Case: rename/should_compile/T14487rename/should_compile/T14487, 14487A, overloadedrecflds/should_fail/DuplicateExports
Note: See TracTickets for help on using tickets.