summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/SimpleOpt.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-08-18 11:22:32 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-19 01:20:03 -0400
commit4ff4d434e9a90623afce00b43e2a5a1ccbdb4c05 (patch)
tree366f4c5c9263136083ca24bc47aaa0ebe2287d60 /compiler/GHC/Core/SimpleOpt.hs
parentcad5a14122cae276a4964e17acd4d2cceb19f01e (diff)
downloadhaskell-4ff4d434e9a90623afce00b43e2a5a1ccbdb4c05.tar.gz
Get the in-scope set right during RULE matching
There was a subtle error in the in-scope set during RULE matching, which led to #20200 (not the original report, but the reports of failures following an initial bug-fix commit). This patch fixes the problem, and simplifies the code a bit. In pariticular there was a very mysterious and ad-hoc in-scope set extension in rnMatchBndr2, which is now moved to the right place, namely in the Let case of match, where we do the floating. I don't have a small repro case, alas.
Diffstat (limited to 'compiler/GHC/Core/SimpleOpt.hs')
-rw-r--r--compiler/GHC/Core/SimpleOpt.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs
index 40e9f138b7..d741aa0351 100644
--- a/compiler/GHC/Core/SimpleOpt.hs
+++ b/compiler/GHC/Core/SimpleOpt.hs
@@ -1327,8 +1327,9 @@ Currently, it is used in GHC.Core.Rules.match, and is required to make
"map coerce = coerce" match.
-}
-exprIsLambda_maybe :: InScopeEnv -> CoreExpr
- -> Maybe (Var, CoreExpr,[CoreTickish])
+exprIsLambda_maybe :: HasDebugCallStack
+ => InScopeEnv -> CoreExpr
+ -> Maybe (Var, CoreExpr,[CoreTickish])
-- See Note [exprIsLambda_maybe]
-- The simple case: It is a lambda already