summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess.hs
diff options
context:
space:
mode:
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