summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Splice.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2020-10-02 20:23:27 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-12-24 16:34:49 -0500
commit6f8bafb4fbddd2c8a113f5ddb04636a3a1be9355 (patch)
tree7169b8ce5f972892c498c30ee48db2028e76edac /compiler/GHC/Rename/Splice.hs
parent9809474462527d36b9e237ee7012b08e0845b714 (diff)
downloadhaskell-6f8bafb4fbddd2c8a113f5ddb04636a3a1be9355.tar.gz
Refactor renamer datastructures
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/Rename/Splice.hs')
-rw-r--r--compiler/GHC/Rename/Splice.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs
index 48378ba670..19d9d333ec 100644
--- a/compiler/GHC/Rename/Splice.hs
+++ b/compiler/GHC/Rename/Splice.hs
@@ -433,7 +433,7 @@ rnSpliceExpr splice
traceRn "rnSpliceExpr: typed expression splice" empty
; lcl_rdr <- getLocalRdrEnv
; gbl_rdr <- getGlobalRdrEnv
- ; let gbl_names = mkNameSet [gre_name gre | gre <- globalRdrEnvElts gbl_rdr
+ ; let gbl_names = mkNameSet [greMangledName gre | gre <- globalRdrEnvElts gbl_rdr
, isLocalGRE gre]
lcl_names = mkNameSet (localRdrEnvElts lcl_rdr)