summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2023-01-20 12:05:29 +0300
committerVladislav Zavialov <vlad.z.4096@gmail.com>2023-01-20 14:53:32 +0300
commit7c53b6be5ec2ee0285818eeccad374f2689c2d65 (patch)
tree51f82abdf085d8ba79e6e8e663b39edb92e22ee0 /compiler/GHC/Parser/PostProcess.hs
parent14b5982a3aea351e4b01c5804ebd4d4629ba6bab (diff)
downloadhaskell-wip/int-index/pun-names.tar.gz
WIP: Punned nameswip/int-index/pun-names
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r--compiler/GHC/Parser/PostProcess.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index 9c0a5df0aa..b033d7a6cd 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -822,6 +822,10 @@ setRdrNameSpace (Exact n) ns
= Exact (mkSystemNameAt (nameUnique n) occ (nameSrcSpan n))
where
occ = setOccNameSpace ns (nameOccName n)
+setRdrNameSpace name@(ExactPun n pun) ns
+ | isTcClsNameSpace ns = name -- No-op (ExactPun is guaranteed to be a TcClsName)
+ | isDataConNameSpace ns = setRdrNameSpace (Exact n) ns -- Data constructors are not puns, so treat this as an ordinary Exact name.
+ | otherwise = pprPanic "setRdrNameSpace" (pprNameSpace ns <+> ppr (n, pun))
setWiredInNameSpace :: TyThing -> NameSpace -> RdrName
setWiredInNameSpace (ATyCon tc) ns