From f3a381ed3888bf634e91400e52204ab2252567d2 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Thu, 10 Apr 2008 08:26:19 +0000 Subject: [PATCH] Make the arity and strictness agree, for wired-in bottoming Ids --- compiler/basicTypes/MkId.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs index a9c4e02..3e63c31 100644 --- a/compiler/basicTypes/MkId.lhs +++ b/compiler/basicTypes/MkId.lhs @@ -1314,10 +1314,14 @@ pcMiscPrelId name ty info -- will be in "the right place" to be in scope. pc_bottoming_Id :: Name -> Type -> Id +-- Function of arity 1, which diverges after being given one argument pc_bottoming_Id name ty = pcMiscPrelId name ty bottoming_info where bottoming_info = vanillaIdInfo `setAllStrictnessInfo` Just strict_sig + `setArityInfo` 1 + -- Make arity and strictness agree + -- Do *not* mark them as NoCafRefs, because they can indeed have -- CAF refs. For example, pAT_ERROR_ID calls GHC.Err.untangle, -- which has some CAFs @@ -1327,7 +1331,7 @@ pc_bottoming_Id name ty -- any pc_bottoming_Id will itself have CafRefs, which bloats -- SRTs. - strict_sig = mkStrictSig (mkTopDmdType [evalDmd] BotRes) + strict_sig = mkStrictSig (mkTopDmdType [evalDmd] BotRes) -- These "bottom" out, no matter what their arguments \end{code} -- 1.7.10.4