summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/TyCl
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2020-07-12 22:08:10 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-22 20:21:48 -0400
commitcfa89149b55837f822ba619b797781813fdcdabc (patch)
tree932b9af9f50b88b137b6faf42050e3e2445d252c /compiler/GHC/Tc/TyCl
parentff1b7710c9975a3cc1025cb5b9d29197a5f1a98a (diff)
downloadhaskell-cfa89149b55837f822ba619b797781813fdcdabc.tar.gz
Define type Void# = (# #) (#18441)
There's one backwards compatibility issue: GHC.Prim no longer exports Void#, we now manually re-export it from GHC.Exts.
Diffstat (limited to 'compiler/GHC/Tc/TyCl')
-rw-r--r--compiler/GHC/Tc/TyCl/Build.hs7
-rw-r--r--compiler/GHC/Tc/TyCl/PatSyn.hs6
2 files changed, 6 insertions, 7 deletions
diff --git a/compiler/GHC/Tc/TyCl/Build.hs b/compiler/GHC/Tc/TyCl/Build.hs
index 5361ff0160..da17266c45 100644
--- a/compiler/GHC/Tc/TyCl/Build.hs
+++ b/compiler/GHC/Tc/TyCl/Build.hs
@@ -21,8 +21,7 @@ import GHC.Prelude
import GHC.Iface.Env
import GHC.Core.FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom )
-import GHC.Builtin.Types( isCTupleTyConName )
-import GHC.Builtin.Types.Prim ( voidPrimTy )
+import GHC.Builtin.Types( isCTupleTyConName, unboxedUnitTy )
import GHC.Core.DataCon
import GHC.Core.PatSyn
import GHC.Types.Var
@@ -209,11 +208,11 @@ buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder
subst = zipTvSubst (univ_tvs1 ++ ex_tvs1)
(mkTyVarTys (binderVars (univ_tvs ++ ex_tvs)))
- -- For a nullary pattern synonym we add a single void argument to the
+ -- For a nullary pattern synonym we add a single (# #) argument to the
-- matcher to preserve laziness in the case of unlifted types.
-- See #12746
compareArgTys :: [Type] -> [Type] -> Bool
- compareArgTys [] [x] = x `eqType` voidPrimTy
+ compareArgTys [] [x] = x `eqType` unboxedUnitTy
compareArgTys arg_tys matcher_arg_tys = arg_tys `eqTypes` matcher_arg_tys
diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs
index 3f276f5945..0be256c93f 100644
--- a/compiler/GHC/Tc/TyCl/PatSyn.hs
+++ b/compiler/GHC/Tc/TyCl/PatSyn.hs
@@ -698,12 +698,12 @@ tcPatSynMatcher (L loc name) lpat
res_ty = mkTyVarTy res_tv
is_unlifted = null args && null prov_dicts
(cont_args, cont_arg_tys)
- | is_unlifted = ([nlHsVar voidPrimId], [voidPrimTy])
+ | is_unlifted = ([nlHsVar voidPrimId], [unboxedUnitTy])
| otherwise = (args, arg_tys)
cont_ty = mkInfSigmaTy ex_tvs prov_theta $
mkVisFunTysMany cont_arg_tys res_ty
- fail_ty = mkVisFunTyMany voidPrimTy res_ty
+ fail_ty = mkVisFunTyMany unboxedUnitTy res_ty
; matcher_name <- newImplicitBinder name mkMatcherOcc
; scrutinee <- newSysLocalId (fsLit "scrut") Many pat_ty
@@ -905,7 +905,7 @@ tcPatSynBuilderOcc ps
add_void :: Bool -> Type -> Type
add_void need_dummy_arg ty
- | need_dummy_arg = mkVisFunTyMany voidPrimTy ty
+ | need_dummy_arg = mkVisFunTyMany unboxedUnitTy ty
| otherwise = ty
tcPatToExpr :: Name -> [Located Name] -> LPat GhcRn