Note [Signature merging DFuns]

GHC/Tc/Utils/Backpack.hs:859 compiler

Once we know all of instances which will be defined by this merged
signature, we go through each of the DFuns and rename them with a fresh,
new, unique DFun Name, and add these DFuns to tcg_type_env (thus fixing
up the "bogus" names that were setup in 'typecheckIfacesForMerging'.

We can't do this fixup earlier, because we need a way to identify each
source DFun (from each of the signatures we are merging in) so that
when we have a ClsInst, we can pull up the correct DFun to check if
the types match.

See also Note [rnIfaceNeverExported] in GHC.Iface.Rename

References 1

Referenced by 3