Make absent-arg wrappers work for unlifted types (fix Trac #4306)
[ghc-hetmet.git] / compiler / coreSyn / CoreUtils.lhs
index 1a21704..103b294 100644 (file)
@@ -72,6 +72,7 @@ import CostCentre
 import Unique
 import Outputable
 import TysPrim
+import PrelNames( absentErrorIdKey )
 import FastString
 import Maybes
 import Util
@@ -670,7 +671,10 @@ exprOkForSpeculation (Case e _ _ alts)
 
 exprOkForSpeculation other_expr
   = case collectArgs other_expr of
-       (Var f, args) -> spec_ok (idDetails f) args
+       (Var f, args) | f `hasKey` absentErrorIdKey     -- Note [Absent error Id]
+                      -> all exprOkForSpeculation args  --    in WwLib
+                      | otherwise 
+                      -> spec_ok (idDetails f) args
         _             -> False
  
   where