[Git][ghc/ghc][wip/romes/static-gadt-con-info] fix: Better accounting for voidrep representations
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Wed Mar 22 19:51:58 UTC 2023
Rodrigo Mesquita pushed to branch wip/romes/static-gadt-con-info at Glasgow Haskell Compiler / GHC
Commits:
2304d2f2 by romes at 2023-03-22T19:51:48+00:00
fix: Better accounting for voidrep representations
Fixes #23158
- - - - -
2 changed files:
- compiler/GHC/Core/DataCon.hs
- + compiler/GHC/Types/RepType.hs-boot
Changes:
=====================================
compiler/GHC/Core/DataCon.hs
=====================================
@@ -88,6 +88,7 @@ import GHC.Core.Predicate
import GHC.Types.Var
import GHC.Types.Var.Env
import GHC.Types.Basic
+import {-# SOURCE #-} GHC.Types.RepType (isZeroBitTy)
import GHC.Data.FastString
import GHC.Unit.Types
import GHC.Utils.Binary
@@ -1675,7 +1676,7 @@ dataConRepArgTys (MkData { dcRep = rep
, dcOrigArgTys = orig_arg_tys
, dcRepTyCon = tc })
= case rep of
- DCR { dcr_arg_tys = arg_tys } -> arg_tys
+ DCR { dcr_arg_tys = arg_tys } -> filter (isZeroBitTy . scaledThing) arg_tys
NoDataConRep
| isTypeDataTyCon tc -> assert (null theta) $
orig_arg_tys
=====================================
compiler/GHC/Types/RepType.hs-boot
=====================================
@@ -0,0 +1,8 @@
+module GHC.Types.RepType where
+
+import GHC.Utils.Misc
+import GHC.Core.TyCo.Rep
+import Data.Bool
+
+isZeroBitTy :: HasDebugCallStack => Type -> Bool
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2304d2f24a96dd4574a6eab7dbacc69799a4e24d
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2304d2f24a96dd4574a6eab7dbacc69799a4e24d
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230322/70f9bf0b/attachment-0001.html>
More information about the ghc-commits
mailing list