Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,865
    • Issues 4,865
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 461
    • Merge requests 461
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13352
Closed
Open
Created Feb 28, 2017 by Eric Crockett@crockeeaReporter

Strange requirement for re-exported duplicate record fields

In the following example,

module A(A(..)) where
data A = A {x::Int}

module B(B(..)) where
data B = B {x::Bool}

{-# LANGUAGE DuplicateRecordFields #-}
module C(A(..),B(..)) where
import A(A(..))
import B(B(..))

I get an error about conflicting exports for 'x'. This doesn't seem right to me: I've got -XDuplicateRecordFields exactly where the duplicate occurs.

However, I noticed that the if I move the pragma to A.hs, C.hs compiles without error:

{-# LANGUAGE DuplicateRecordFields #-}
module A(A(..)) where
data A = A {x::Int}

module B(B(..)) where
data B = B {x::Bool}

module C(A(..),B(..)) where
import A(A(..))
import B(B(..))

This is bizarre because it is asymmetric (I arbitrarily put the pragma in A.hs, but it need not occur in B.hs), and because no duplicate records exist in module A, but they do exist in module C, where the pragma isn't needed.

Trac metadata
Trac field Value
Version 8.0.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
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
Assignee
Assign to
Time tracking