summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-08-28 16:38:54 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2013-08-29 16:45:19 +0100
commit04c9c3b23065916b7beb9cebc959a05786f01dbe (patch)
treefae94d20a12435bd67f119a9dba6122ea9a070c9
parentff3d07addf6af962c4d0e69d2ac02218643046d1 (diff)
downloadhaskell-04c9c3b23065916b7beb9cebc959a05786f01dbe.tar.gz
Refactor to avoid gratuitous DEBUG warning
-rw-r--r--compiler/coreSyn/CoreUtils.lhs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index bdd048dfba..06f167cce0 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -1623,10 +1623,10 @@ tryEtaReduce bndrs body
-- for why we have an accumulating coercion
go [] fun co
| ok_fun fun
- , let result = mkCast fun co
- , not (any (`elemVarSet` exprFreeVars result) bndrs)
- = Just result -- Check for any of the binders free in the result
- -- including the accumulated coercion
+ , let used_vars = exprFreeVars fun `unionVarSet` tyCoVarsOfCo co
+ , not (any (`elemVarSet` used_vars) bndrs)
+ = Just (mkCast fun co) -- Check for any of the binders free in the result
+ -- including the accumulated coercion
go (b : bs) (App fun arg) co
| Just co' <- ok_arg b arg co