[commit: ghc] master: Remove a bogus warning (30b1fe2)

git at git.haskell.org git at git.haskell.org
Wed Jan 10 08:21:03 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/30b1fe2f305097955870ada93700eb149a05b4ef/ghc

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

commit 30b1fe2f305097955870ada93700eb149a05b4ef
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Jan 9 13:51:40 2018 +0000

    Remove a bogus warning
    
    The new comment explains why this warning can
    legitimately fire, so I've removed it entirely.
    Lint will cath any bad cases.


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

30b1fe2f305097955870ada93700eb149a05b4ef
 compiler/simplCore/OccurAnal.hs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs
index 2be47fb..bcc8410 100644
--- a/compiler/simplCore/OccurAnal.hs
+++ b/compiler/simplCore/OccurAnal.hs
@@ -2169,7 +2169,12 @@ markJoinOneShots mb_join_arity bndrs
       Just n  -> go n bndrs
  where
    go 0 bndrs  = bndrs
-   go _ []     = WARN( True, ppr mb_join_arity <+> ppr bndrs ) []
+   go _ []     = [] -- This can legitimately happen.
+                    -- e.g.    let j = case ... in j True
+                    -- This will become an arity-1 join point after the
+                    -- simplifier has eta-expanded it; but it may not have
+                    -- enough lambdas /yet/. (Lint checks that JoinIds do
+                    -- have enough lambdas.)
    go n (b:bs) = b' : go (n-1) bs
      where
        b' | isId b    = setOneShotLambda b



More information about the ghc-commits mailing list