summaryrefslogtreecommitdiff
path: root/compiler/GHC/Hs/Pat.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-11-26 20:28:07 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-29 11:03:19 -0500
commit7ea665bfed7c9915038d8ea6cb820479970a10fa (patch)
tree273c914bedb77aad5da17a26115aab56ad85e590 /compiler/GHC/Hs/Pat.hs
parent1dc0d7af974cbd88a7aa70ba61fc0d7369a20433 (diff)
downloadhaskell-7ea665bfed7c9915038d8ea6cb820479970a10fa.tar.gz
TTG: replace Void/NoExtCon with DataConCantHappen
There were two ways to indicate that a TTG constructor is unused in a phase: `NoExtCon` and `Void`. This unifies the code, and uses the name 'DataConCantHappen', following the discussion at MR 7041. Updates haddock submodule
Diffstat (limited to 'compiler/GHC/Hs/Pat.hs')
-rw-r--r--compiler/GHC/Hs/Pat.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs
index a98070c6a7..43f161f9bd 100644
--- a/compiler/GHC/Hs/Pat.hs
+++ b/compiler/GHC/Hs/Pat.hs
@@ -82,7 +82,6 @@ import GHC.Types.Name (Name)
import GHC.Driver.Session
import qualified GHC.LanguageExtensions as LangExt
import Data.Data
-import Data.Void
type instance XWildPat GhcPs = NoExtField
@@ -139,7 +138,7 @@ type instance XViewPat GhcTc = Type
type instance XSplicePat GhcPs = NoExtField
type instance XSplicePat GhcRn = NoExtField
-type instance XSplicePat GhcTc = Void -- See Note [Constructor cannot occur]
+type instance XSplicePat GhcTc = DataConCantHappen
type instance XLitPat (GhcPass _) = NoExtField
@@ -155,7 +154,7 @@ type instance XSigPat GhcPs = EpAnn [AddEpAnn]
type instance XSigPat GhcRn = NoExtField
type instance XSigPat GhcTc = Type
-type instance XXPat GhcPs = NoExtCon
+type instance XXPat GhcPs = DataConCantHappen
type instance XXPat GhcRn = HsPatExpansion (Pat GhcRn) (Pat GhcRn)
-- Original pattern and its desugaring/expansion.
-- See Note [Rebindable syntax and HsExpansion].
@@ -356,7 +355,7 @@ pprPat (ConPat { pat_con = con
pprPat (XPat ext) = case ghcPass @p of
#if __GLASGOW_HASKELL__ < 811
- GhcPs -> noExtCon ext
+ GhcPs -> dataConCantHappen ext
#endif
GhcRn -> case ext of
HsPatExpanded orig _ -> pprPat orig
@@ -567,7 +566,7 @@ isIrrefutableHsPat' is_strict = goL
go (XPat ext) = case ghcPass @p of
#if __GLASGOW_HASKELL__ < 811
- GhcPs -> noExtCon ext
+ GhcPs -> dataConCantHappen ext
#endif
GhcRn -> case ext of
HsPatExpanded _ pat -> go pat
@@ -630,7 +629,7 @@ patNeedsParens p = go @p
go (ViewPat {}) = True
go (XPat ext) = case ghcPass @q of
#if __GLASGOW_HASKELL__ < 901
- GhcPs -> noExtCon ext
+ GhcPs -> dataConCantHappen ext
#endif
GhcRn -> case ext of
HsPatExpanded orig _ -> go orig