summaryrefslogtreecommitdiff
path: root/compiler/GHC/IfaceToCore.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-05-27 12:02:45 +0100
committerBen Gamari <ben@smart-cactus.org>2021-06-04 15:11:16 -0400
commita32f41a14a3f2d3245e36033f44d326415428f37 (patch)
tree8acffaedb40069e6630e680c1d7e7bbe87ff6ca1 /compiler/GHC/IfaceToCore.hs
parent0f56e4c14a34d4f3e69652db9b2662b57eb6467a (diff)
downloadhaskell-a32f41a14a3f2d3245e36033f44d326415428f37.tar.gz
Re-do rubbish literals
As #19882 pointed out, we were simply doing rubbish literals wrong. (I'll refrain from explaining the wrong-ness here -- see the ticket.) This patch fixes it by adding a Type (of kind RuntimeRep) as field of LitRubbish, rather than [PrimRep]. The Note [Rubbish literals] in GHC.Types.Literal explains the details.
Diffstat (limited to 'compiler/GHC/IfaceToCore.hs')
-rw-r--r--compiler/GHC/IfaceToCore.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs
index e72c931ae6..de65e43ccd 100644
--- a/compiler/GHC/IfaceToCore.hs
+++ b/compiler/GHC/IfaceToCore.hs
@@ -1454,6 +1454,10 @@ tcIfaceExpr (IfaceLcl name)
tcIfaceExpr (IfaceExt gbl)
= Var <$> tcIfaceExtId gbl
+tcIfaceExpr (IfaceLitRubbish rep)
+ = do rep' <- tcIfaceType rep
+ return (Lit (LitRubbish rep'))
+
tcIfaceExpr (IfaceLit lit)
= do lit' <- tcIfaceLit lit
return (Lit lit')