Skip to content

Qualified duplicate record fields are reported with incorrect module names in error messages

Similar to the DRFHoleFits test, we have

{-# LANGUAGE DuplicateRecordFields #-}
module T23063_aux where

data S = MkS { foo :: Int }

----------------------------------------

{-# LANGUAGE DuplicateRecordFields #-}
module T23063 where
import qualified T23063_aux as A

baz = _ :: A.S -> Int

The hole fit for baz should report A.foo, but instead it reports T23063_aux.foo:

       Valid hole fits include
         T23063_aux.foo :: A.S -> Int

This is due to the tricks one needs to play to avoid showing a mangled field name to the user. I am fixing this in !8686 (merged).

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