Skip to content

Bad interaction of hs-boot files with DuplicateRecordFields

The consistency check for a boot file seems to get confused by the fact that we don't generate a selector with -XDuplicateRecordFields:

-- M.hs-boot
module M where
  data A
  fld :: A -> A

-- M.hs
{-# LANGUAGE DuplicateRecordFields #-}
module M where
  data A = MkA { fld :: A }
  data B = MkB { fld :: B }

-- N.hs
module N where
  import {-# SOURCE #-} M ( fld )
  bar = fld
M.hs-boot: error:
    `M.fld' is exported by the hs-boot file, but not exported by the module
  |
3 |   fld :: A -> A
  |   ^^^^^^^^^^^^^^

I'm hoping to fix this bug in !8686 (merged).

Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information