summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2020-10-02 20:23:27 +0100
committerAdam Gundry <adam@well-typed.com>2020-12-23 21:40:27 +0000
commit4a551438faa6c6311ca951f994801ea18313a68e (patch)
treef7b490e9f80f4ba6e3b7fb84456c00806f95c1d2 /compiler/GHC.hs
parent79d41f93a98d1a331f7c2dfee55da9c1fea01380 (diff)
downloadhaskell-wip/amg/renamer-refactor.tar.gz
Refactor renamer datastructureswip/amg/renamer-refactor
This patch significantly refactors key renamer datastructures (primarily Avail and GlobalRdrElt) in order to treat DuplicateRecordFields in a more robust way. In particular it allows the extension to be used with pattern synonyms (fixes where mangled record selector names could be printed instead of field labels (e.g. with -Wpartial-fields or hole fits, see new tests). The key idea is the introduction of a new type GreName for names that may represent either normal entities or field labels. This is then used in GlobalRdrElt and AvailInfo, in place of the old way of representing fields using FldParent (yuck) and an extra list in AvailTC. Updates the haddock submodule.
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 65c1f4130b..60b7a3e639 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -1399,7 +1399,7 @@ modInfoTyThings minf = typeEnvElts (minf_type_env minf)
modInfoTopLevelScope :: ModuleInfo -> Maybe [Name]
modInfoTopLevelScope minf
- = fmap (map gre_name . globalRdrEnvElts) (minf_rdr_env minf)
+ = fmap (map greMangledName . globalRdrEnvElts) (minf_rdr_env minf)
modInfoExports :: ModuleInfo -> [Name]
modInfoExports minf = concatMap availNames $! minf_exports minf