[commit: ghc] master: Refactor to avoid gratuitous DEBUG warning (04c9c3b)
git at git.haskell.org
git at git.haskell.org
Thu Aug 29 17:45:50 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/04c9c3b23065916b7beb9cebc959a05786f01dbe/ghc
>---------------------------------------------------------------
commit 04c9c3b23065916b7beb9cebc959a05786f01dbe
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Aug 28 16:38:54 2013 +0100
Refactor to avoid gratuitous DEBUG warning
>---------------------------------------------------------------
04c9c3b23065916b7beb9cebc959a05786f01dbe
compiler/coreSyn/CoreUtils.lhs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index bdd048d..06f167c 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
More information about the ghc-commits
mailing list