[commit: ghc] master: Don't complain about rules overlapping functions with no unfolding (b3f9c91)

git at git.haskell.org git at git.haskell.org
Fri Nov 22 10:13:30 UTC 2013


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

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

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

commit b3f9c9100c3850dc502fa3ee3d06d5a406681359
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Nov 21 22:47:01 2013 +0000

    Don't complain about rules overlapping functions with no unfolding
    
    This showed up when importing a module that was compiled
    without -O, so there were no unfoldings in the interface file


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

b3f9c9100c3850dc502fa3ee3d06d5a406681359
 compiler/deSugar/Desugar.lhs |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs
index 46b6492..f0d28d0 100644
--- a/compiler/deSugar/Desugar.lhs
+++ b/compiler/deSugar/Desugar.lhs
@@ -366,6 +366,8 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs))
 
               inline_shadows_rule   -- Function can be inlined before rule fires
                 | wopt Opt_WarnInlineRuleShadowing dflags
+                , isLocalId fn_id || hasSomeUnfolding (idUnfolding fn_id)   
+                       -- If imported with no unfolding, no worries
                 = case (idInlineActivation fn_id, act) of
                     (NeverActive, _)    -> False
                     (AlwaysActive, _)   -> True



More information about the ghc-commits mailing list