[commit: ghc] wip/discount-fv: Include lambda binder in scope (e29f88b)

git at git.haskell.org git at git.haskell.org
Tue Jan 24 17:20:10 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/discount-fv
Link       : http://ghc.haskell.org/trac/ghc/changeset/e29f88b5d952f2f40f68e2bb49f051b6684d2686/ghc

>---------------------------------------------------------------

commit e29f88b5d952f2f40f68e2bb49f051b6684d2686
Author: alexbiehl <alex.biehl at gmail.com>
Date:   Mon Jan 23 21:30:35 2017 +0100

    Include lambda binder in scope


>---------------------------------------------------------------

e29f88b5d952f2f40f68e2bb49f051b6684d2686
 compiler/coreSyn/CoreUnfold.hs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/coreSyn/CoreUnfold.hs b/compiler/coreSyn/CoreUnfold.hs
index 36ea382..e72d95a 100644
--- a/compiler/coreSyn/CoreUnfold.hs
+++ b/compiler/coreSyn/CoreUnfold.hs
@@ -523,8 +523,9 @@ sizeExpr dflags bOMB_OUT_SIZE top_args expr
                         size_up_app is fun [arg] (if isRealWorldExpr arg then 1 else 0)
 
     size_up is (Lam b e)
-      | isId b && not (isRealWorldId b) = lamScrutDiscount dflags (size_up is e `addSizeN` 10)
-      | otherwise = size_up is e
+      | isId b && not (isRealWorldId b) = lamScrutDiscount dflags (size_up is' e `addSizeN` 10)
+      | otherwise = size_up is' e
+      where is' = extendInScopeSet is b
 
     size_up is (Let (NonRec binder rhs) body)
       = let



More information about the ghc-commits mailing list