Robustify the treatement of DFunUnfolding
[ghc-hetmet.git] / compiler / coreSyn / CoreFVs.lhs
index 3ff583e..46c21b2 100644 (file)
@@ -421,10 +421,11 @@ idUnfoldingVars :: Id -> VarSet
 -- we might get out-of-scope variables
 idUnfoldingVars id
   = case realIdUnfolding id of
-      CoreUnfolding { uf_tmpl = rhs, uf_guidance = InlineRule {} }
-                          -> exprFreeVars rhs
-      DFunUnfolding _ args -> exprsFreeVars args
-      _                    -> emptyVarSet
+      CoreUnfolding { uf_tmpl = rhs, uf_src = src }
+                            | isInlineRuleSource src
+                            -> exprFreeVars rhs
+      DFunUnfolding _ _ args -> exprsFreeVars args
+      _                      -> emptyVarSet
 \end{code}