summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Opt/Simplify.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-06-18 09:38:00 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-23 22:49:33 -0400
commit181516bcd6f18f22e1df3915bfca0c36524a725b (patch)
tree6e44618b345e22179640e4cb003ec1e61a6f39c7 /compiler/GHC/Core/Opt/Simplify.hs
parenta2a9006b068ba9af9d41711307a8d597d2bb03d7 (diff)
downloadhaskell-181516bcd6f18f22e1df3915bfca0c36524a725b.tar.gz
Fix a buglet in Simplify.simplCast
This bug, revealed by #18347, is just a missing update to sc_hole_ty in simplCast. I'd missed a code path when I made the recentchanges in commit 6d49d5be904c0c01788fa7aae1b112d5b4dfaf1c Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu May 21 12:53:35 2020 +0100 Implement cast worker/wrapper properly The fix is very easy. Two other minor changes * Tidy up in SimpleOpt.simple_opt_expr. In fact I think this is an outright bug, introduced in the fix to #18112: we were simplifying the same coercion twice *with the same substitution*, which is just wrong. It'd be a hard bug to trigger, so I just fixed it; less code too. * Better debug printing of ApplyToVal
Diffstat (limited to 'compiler/GHC/Core/Opt/Simplify.hs')
-rw-r--r--compiler/GHC/Core/Opt/Simplify.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs
index 81cf962d91..dba4362a81 100644
--- a/compiler/GHC/Core/Opt/Simplify.hs
+++ b/compiler/GHC/Core/Opt/Simplify.hs
@@ -1456,7 +1456,8 @@ simplCast env body co0 cont0
= {-#SCC "addCoerce-pushCoValArg" #-}
do { tail' <- addCoerceM m_co2 tail
; if isReflCo co1
- then return (cont { sc_cont = tail' })
+ then return (cont { sc_cont = tail'
+ , sc_hole_ty = coercionLKind co })
-- Avoid simplifying if possible;
-- See Note [Avoiding exponential behaviour]
else do